var result = db.Work_Process .GroupJoin(db.Base_Station, A => A.StationNo, B => B.StationNo, (A, AB) => new { A, B = AB.DefaultIfEmpty() }) .GroupBy(x => new { x.A.StationNo, x.B.FirstOrDefault().SortIndex }) .OrderBy(x => x.Key.SortIndex) .Select(g => new { StationNo = g.Key.StationNo, Count = g.Count() });

将LINQ查询语句转换为Lambda表达式

原文地址: http://www.cveoy.top/t/topic/f2Ri 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录