How to get unique elements from the list based on Property string Name
?
I have tried this, but it doesn't work. Resulting List is sorted and grouped, but duplicated elements are not removed:
List<ElementType> uniqueTypes = types.OrderBy(g => g.Name)
.GroupBy(g => g.Name).Select(s => s.First()).ToList();
Any help, much appreciated.