[HttpGet]
public JsonResult GetListInfo(string rid, string sidx, string sord, int page, int rows)
{
var jqGridResponse = new JqGridResponse<IdeIdentEit> { PageIndex = page, PageSize = rows };
IQueryable<IdeIdentEit> data = noteRepository.GetListByRid(rid);
jqGridResponse.TotalRecordsCount = data.Count();
var pagedViewModel = new PagedViewModel<IdeIdentEit>
{
Query = data.OfType<IdeIdentEit>(),
GridSortOptions = new GridSortOptions { Column = sidx, Direction = sord.Equals("asc") ? SortDirection.Ascending : SortDirection.Descending },
DefaultSortColumn = sidx,
Page = page,
PageSize = rows,
}
.Setup();
pagedViewModel.PagedList.AsParallel().ToList().ForEach(p => DomainObjectToJson(jqGridResponse, p));
但又是获得了8条数据的。分页时出错了,我是把新建立了一个实体表IdeIdentEit,放入了两张表的字段,现在是把两张表的数据部分展现到Jqgrid上。数据得到了,但会出这个错,怎么回事,求解??
return jqGridResponse.ToJsonResult();
}
代码如上,最后这里报的错 pagedViewModel.PagedList.AsParallel().ToList().ForEach(p => DomainObjectToJson(jqGridResponse, p));