Linq选择记录范围
发布时间:2021-01-18 21:30 所属栏目:116 来源:网络整理
导读:var q = (from Comments in db.tblBlogComments where Comments.blogID == this.ID orderby Comments.date descending select new { Comments.userID,Comments.comment,Comments.date }); 这将返回所有关联的记录,我最好如何选择记录#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 }); 这将返回所有关联的记录,我最好如何选择记录#10到#20,这样我就不会加载任何冗余数据? 解决方法怎么样:var q = ( from Comments in db.tblBlogComments where Comments.blogID == this.ID orderby Comments.date descending select new { Comments.userID,Comments.date }).Skip(10).Take(10); (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读