码迷,mamicode.com
首页 > 其他好文 > 详细

ef not in和 GroupBy 分组

时间:2015-01-21 22:38:59      阅读:545      评论:0      收藏:0      [点我收藏+]

标签:

ef 分组 排序 之后取第一行 
List<InstrStateDetail> listGroupPost = this.Select().GroupBy(i => i.InstrCode).Select(i => i.OrderByDescending(j => 

j.OccurDateTime).FirstOrDefault()).ToList();
ef 分组 排序 之后取所有数据
List<InstrStateDetail> listGroupPost = this.Select().GroupBy(i => i.InstrCode).SelectMany(i => i.OrderByDescending(j => 

j.OccurDateTime)).ToList();
not in linq
List<InstrStateDetail> breakInstr = bllInstrStateDetail.GetBreakState();
var xx=(from c in measStateDetail where !((from d in breakInstr select d.InstrCode).Contains(c.InstrCode)) select c).ToList()
not in ef
listSP= query1.Where(m => !query2.Contains(m.ETPRS_CODE)).ToList();

ef not in和 GroupBy 分组

标签:

原文地址:http://blog.csdn.net/zhishiheng/article/details/42975805

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