Answers for "linq unique value c#"

C#
1

c# linq select only unique values from list

var uniq = allvalues.GroupBy(x => x.Id).Select(y=>y.First()).Distinct();
Posted by: Guest on November-17-2020
0

c# linq unique by property

List<Person> distinctPeople = allPeople
   .GroupBy(p => p.PersonId)
   .Select(g => g.FirstOrDefault())
   .ToList();
Posted by: Guest on November-19-2021

C# Answers by Framework

Browse Popular Code Answers by Language