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 PredicateEqualityComparer

289 Views
Copy Code Show/Hide Line Numbers
   1:  public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, bool> predicate)
   2:  {
   3:      return source.Distinct(new PredicateEqualityComparer<TSource>(predicate));
   4:  }
by Paulo Morgado
  April 10, 2010 @ 5:21am
Tags:
Description:
Using the PredicateEqualityComparer 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