Tom*_*len 3 linq paging pagination sql-server-2008
var q = (from Comments in db.tblBlogComments where Comments.blogID == this.ID orderby Comments.date descending select new {
Comments.userID, Comments.comment, Comments.date
});
Run Code Online (Sandbox Code Playgroud)
这将返回我所有的关联记录,我如何最好地选择记录 #10 到 #20,这样我就不会加载任何冗余数据?
怎么样:
var q = (
from Comments in db.tblBlogComments
where Comments.blogID == this.ID
orderby Comments.date descending
select new { Comments.userID, Comments.comment, Comments.date }).Skip(10).Take(10);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6485 次 |
| 最近记录: |