标签: mvcjqgrid

必须在方法'Skip'Exception之前调用'OrderBy'方法

我试图实现jQgrid使用MvcjQgrid,我得到了这个例外.

System.NotSupportedException was unhandled by user code
  Message=The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.
Run Code Online (Sandbox Code Playgroud)

虽然在Skip方法之前使用OrdeyBy为什么它会产生异常?怎么解决?

我在控制器中遇到异常:

public ActionResult GridDataBasic(GridSettings gridSettings)
        {          
            var jobdescription = sm.GetJobDescription(gridSettings);
            var totalJobDescription = sm.CountJobDescription(gridSettings);

            var jsonData = new
            {
                total = totalJobDescription / gridSettings.PageSize + 1,
                page = gridSettings.PageIndex,
                records = totalJobDescription,
                rows = (
                    from j in jobdescription
                    select new
                    {
                        id = j.JobDescriptionID, …
Run Code Online (Sandbox Code Playgroud)

linq-to-entities entity-framework asp.net-mvc-3 mvcjqgrid

9
推荐指数
1
解决办法
3万
查看次数