Created
January 22, 2016 19:31
-
-
Save beufordy3k/8df5e73560f29afd4ba9 to your computer and use it in GitHub Desktop.
Enumerable extension methods that utilize the LambdaComparer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class EnumerableExtensions | |
{ | |
public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> enumerable, Func<TSource, TSource, bool> comparer) | |
{ | |
return enumerable.Distinct(new LambdaComparer<TSource>(comparer)); | |
} | |
public static IEnumerable<TSource> Except<TSource>(this IEnumerable<TSource> enumerable, IEnumerable<TSource> comparison, Func<TSource, TSource, bool> comparer) | |
{ | |
return enumerable.Except(comparison, new LambdaComparer<TSource>(comparer)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment