Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# distinct comparer multiple properties

List<Person> distinctPeople = allPeople
  .GroupBy(p => new {p.PersonId, p.FavoriteColor} )
  .Select(g => g.First())
  .ToList();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #distinct #comparer #multiple #properties
ADD COMMENT
Topic
Name
7+2 =