Answers for "c# linq get list of unique values and list of distinct 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
1

how to get unique list in c#

using(var dataModel = new DataModel())
{
  var classes = dataModel.Attributes.Where(a => a.Field == "Class").Select(a => a.Key).Distinct().ToList();
}
Posted by: Guest on January-07-2021

Code answers related to "c# linq get list of unique values and list of distinct values"

C# Answers by Framework

Browse Popular Code Answers by Language