select distinct record in asp net core linq .net code example
Example: C# .NET Core linq Distinct
var distinctUsers = allUsers
.GroupBy(x => x.UserId)
.Select(x => x.First())
.ToList();
var distinctUsers = allUsers
.GroupBy(x => x.UserId)
.Select(x => x.First())
.ToList();