【发布时间】:2015-01-27 20:13:45
【问题描述】:
我想创建分页,我的 LINQ 查询出错:
var query = from c in db.Projects.Take(2).Skip(2) orderby c.ProjectId descending select c;
给出以下错误:
$exception {"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'."} System.Exception {System.NotSupportedException}
【问题讨论】:
-
方法'OrderBy'必须被调用之前方法'Skip'应该是显而易见的
-
不是每个人都能阅读。许多拒绝阅读的人仍在尝试编程。
标签: c# asp.net-mvc linq entity-framework asp.net-mvc-5