Answers for "list distinct c#"

C#
3

C# .NET Core linq Distinct

var distinctUsers = allUsers
    .GroupBy(x => x.UserId)
    .Select(x => x.First())
    .ToList();
Posted by: Guest on June-30-2020
1

c# linq select only unique values from list

var uniqueCategories =  repository.GetAllProducts()
                                  .Select(p=>p.Category)
                                  .Distinct();
Posted by: Guest on November-17-2020
0

unique items in list c#

var uniqueItemsList = yourList.Distinct().ToList();
Posted by: Guest on October-19-2020
1

c# get distinct values all fields from list

if (!IsPostBack) {  
       GridView1.DataSource = GetProducts()
                              .GroupBy(o => new { o.Make, o.Model })
                              .Select(o => o.FirstOrDefault());
       GridView1.DataBind();
}
Posted by: Guest on November-25-2020

C# Answers by Framework

Browse Popular Code Answers by Language