public IHttpActionResult GetRoleById(int?Id) { var response = new DataResponse <EntityRoles>(); var repository = new RepositoryRoles(); if (Id.HasValue) { response = repository.GetRolesById(Id.Value); } else { response.Model = new EntityRoles(); } return(Ok <DataResponse>(response)); }
public IHttpActionResult GetRolesById(int id) { var response = new DataResponse <EntityRoles>(); if (id != 0) { response = repository.GetRolesById(id); return(Ok <DataResponse>(response)); } else { return(null); } }