C# Lamda GroupJoin的使用
2020-12-25 11:27
标签:使用 class lan var tps htm lock https href 参考: https://www.cnblogs.com/zitjubiz/p/a-left-outer-join-using-linq-extension-methods.html C# Lamda GroupJoin的使用 标签:使用 class lan var tps htm lock https href 原文地址:https://www.cnblogs.com/TTonly/p/13396075.html 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();
文章标题:C# Lamda GroupJoin的使用
文章链接:http://soscw.com/index.php/essay/38137.html