public class user_collection_DistinctBy_userId : IEqualityComparer<User> { public bool Equals(User x, User y) { if (x.UserId == y.UserId) { return true; } else { return false; } } public int GetHashCode(User obj) { return 0; } }