문제

List
I need to filter this list.
I just want to have those person that have the same SalId and those must be at least two.

How do I do it?

도움이 되었습니까?

해결책

var dupSalIdPersons = persons
  .GroupBy(p => p.SalId)
  .Where(g => g.Count() >= 2)
  .SelectMany(g =>  g);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top