If you want to user LINQ distinct have to override IEquatable.Equals method. Rather using this it can be easily achieved like this ;
var distinctItems = items
.GroupBy(x => x.PropertyToCompare)
.Select(x => x.First());
var distinctItems = items
.GroupBy(x => x.PropertyToCompare)
.Select(x => x.First());
Comments