public static IEnumerable <T> DistinctBy <T, TKey>(this IEnumerable <T> items, Func <T, TKey> property) { GeneralPropertyComparer <T, TKey> comparer = new GeneralPropertyComparer <T, TKey>(property); return(items.Distinct(comparer)); }
public static IEnumerable <TSource> DistinctBy <TSource, TKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector) { var comparer = new GeneralPropertyComparer <TSource, TKey>(keySelector); return(source.Distinct(comparer)); }