CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

LINQ: Enhancing Distinct With The SelectorEqualityComparer

250 Views
Copy Code Show/Hide Line Numbers
   1:  public static IEnumerable<TSource> Distinct<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector)
   2:  {
   3:      return source.Distinct(new SelectorEqualityComparer<TSource, TKey>(selector));
   4:  }
by Paulo Morgado
  April 10, 2010 @ 5:22am
Tags:
Description:
Using the SelectorEqualityComparer to enhace the LINQ Distinct API.

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate