I have a list of objects.
public class UserProperties
{
public int Id { get;set; }
public string Name { get;set; }
public string ColorCode { get; set; }
}
List<UserProperties> userList = new List<UserProperties>();
I need to take a distinct list from this. Here, Id
field is a unique field. Is there any possibility to take distinct list?
If it is list of strings means, then use the distinct
. It will work. But in my case, it is a list of objects. We can't use the distinct directly.