c# .net linq distinct code example
Example 1: C# .NET Core linq Distinct
var distinctUsers = allUsers
.GroupBy(x => x.UserId)
.Select(x => x.First())
.ToList();
Example 2: how to use distinct in linq query in c#
var distValues = objList.Select(o=>o.typeId).Distinct().ToList();