Linq Distinct & Group by 하기

 

var result = myList.GroupBy(test => test.id)
                   .Select(grp => grp.First())
                   .ToList();
또는
        var q = from c in dt.AsEnumerable()
                group c by c.Field<string>("WSOperate") into g
                select new
                {
                    WSOperate = g.Key
                };

+ Recent posts