public HttpResponseMessage GetListPaging(HttpRequestMessage request, string filter) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; int totalCount = 0; var filterObj = JsonConvert.DeserializeObject <DynamicFilter>(filter); var user = _userManager.FindById(User.Identity.GetUserId()); var roles = _applicationGroupService.GetRolesByUserId(user.Id).Select(x => x.Name).ToList(); var initiatives = _initiativeService.GetAll(filterObj, out totalCount, roles, user.Id); var data = new GridModel <Initiative>() { items = initiatives, totalCount = totalCount }; response = request.CreateResponse(HttpStatusCode.OK, data); return response; })); }