Skip to content

Instantly share code, notes, and snippets.

@alfredodev
Created June 18, 2014 11:07
Show Gist options
  • Select an option

  • Save alfredodev/48367b4c643295383df6 to your computer and use it in GitHub Desktop.

Select an option

Save alfredodev/48367b4c643295383df6 to your computer and use it in GitHub Desktop.
public static class LinqExtensions
{
public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, bool> predicate)
{
return source.Distinct(new PredicateEqualityComparer<TSource>(predicate));
}
public static IEnumerable<TSource> OrderBy<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, bool> predicate)
{
return source.OrderBy(new PredicateEqualityComparer<TSource>(predicate));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment