111,097
社区成员




var result = from r in lst
group r by r.Phone into g
where g.Count() > 1
select g;
//遍历分组结果集
foreach (var item in result)
{
foreach (A u in item)
{
Console.WriteLine(u.ID);
}
}
from l in list
group l by l.Phone into g
where g.Count()>1
select g;
上面写错了,要改成>1from l in list
group l by l.Phone into g
where g.Count()>0
select g;