I have a list of objects with three integer properties. How can I get the distinct values of first integer property from my list?
This should work,
List<int> result = YourListObject.Select(o => o.FirstInteger).Distinct().ToList();
2.1m questions
2.1m answers
60 comments
56.9k users