Answers for "C# list select only unique values"

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# list with only unique items

If your requirements are to have no duplicates, you should be using a HashSet.
HashSet.Add will return false when the item already exists (if that even matters to you).
Posted by: Guest on October-08-2020

Code answers related to "C# list select only unique values"

C# Answers by Framework

Browse Popular Code Answers by Language