码迷,mamicode.com
首页 > 编程语言 > 详细

MVC中构建Linq条件、排序、Selector字段过滤

时间:2017-05-31 18:55:13      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:_id   domain   代码   expr   class   nbsp   sys   contains   cto   

代码:

System.Linq.Expressions.Expression<Func<Domain.S_ROLE, bool>> expressWhere1 = (c => c.R_NAME.Contains(keywords));
System.Linq.Expressions.Expression
<Func<Domain.S_ROLE, int>> orderBy1 = c => c.R_ORDERID; Func<IQueryable<Domain.S_ROLE>, List<Domain.S_ROLE>> selector1 = (c=>c.Select(p => new Domain.S_ROLE (){ R_ID = p.R_ID, R_NAME= p.R_NAME }).ToList<Domain.S_ROLE>());

分别是 条件、排序、字段过滤。

 

MVC中构建Linq条件、排序、Selector字段过滤

标签:_id   domain   代码   expr   class   nbsp   sys   contains   cto   

原文地址:http://www.cnblogs.com/xsj1989/p/6925203.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!