LINQ 关联数据

关联JOIN

var query = from p in src1
            join p2 in src2 on p.Guid equals p2.Guid
            select new
            {
                item1 = p,
                item2 = p2,
            };

分组GROUP

var gg = from p in src1
          group p by p.Type into g
          let first = g.OrderBy(o => o.Ip).First()
          select new DemoDto
          {
              Key = first.Key,
              Value = first.Value,
          };

SelectMany

SelectMany

posted @ 2021-07-01 14:30  wesson2019  阅读(50)  评论(0编辑  收藏  举报