C#LamdaGroupJoin的使用 [操作系统入门]
var group = countylist.GroupJoin( list,
(countyinfo l1) => new { l1.Countycode },
(Result l2) => new { l2.Countycode },
(item1, item2) => new
{
item1,
item2
}) //2列表left jion
.SelectMany(p => p.item2.DefaultIfEmpty(), (p, l2) => new
{
countyId=p.item1.Countycode,
地区= p.item1.Countyname,
//countyname = l2 == null ? string.Empty : l2.Countyname,
低 = p.item2.Count(n => n.FX == "低"),
合计 = p.item2.Count()
}).Distinct().ToList();
参考:
https://www.cnblogs.com/zitjubiz/p/a-left-outer-join-using-linq-extension-methods.html
C# Lamda GroupJoin的使用
以上是 C#LamdaGroupJoin的使用 [操作系统入门] 的全部内容, 来源链接: utcz.com/z/518840.html