【发布时间】:2017-06-07 14:58:34
【问题描述】:
我们在 LINQ to SQL 中有 orderby 子句,如下所示,但是我们有什么要分页的吗?
from trans in DB.transactions
orderby trans.column descending
select trans;
或者我们必须手动(有点)像下面的查询一样?
(from trans in DB.transactions
orderby trans.column descending
select trans).Skip(noOfRecords).Take(pageSize);
【问题讨论】:
-
是的。你必须通过帮助
Skip和Take方法来做到这一点。
标签: c# entity-framework linq linq-to-sql pagination