Пример #1
0
 public static IEnumerable <TSource> Union <TSource, TCompareKey>(this IEnumerable <TSource> first, IEnumerable <TSource> second, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(first.Union(second, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #2
0
 public static bool SequenceEqual <TSource, TCompareKey>(this IEnumerable <TSource> first, IEnumerable <TSource> second, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(first.SequenceEqual(second, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #3
0
 public static ILookup <TKey, TElement> ToLookup <TSource, TKey, TElement, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TSource, TElement> elementSelector, Func <TKey, TCompareKey> compareKeySelector)
 {
     return(source.ToLookup(keySelector, elementSelector, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #4
0
 public static IEnumerable <TResult> GroupBy <TSource, TKey, TElement, TResult, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TSource, TElement> elementSelector, Func <TKey, IEnumerable <TElement>, TResult> resultSelector, Func <TKey, TCompareKey> compareKeySelector)
 {
     return(source.GroupBy(keySelector, elementSelector, resultSelector, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #5
0
 public static IEnumerable <TResult> Join <TOuter, TInner, TKey, TResult, TCompareKey>(this IEnumerable <TOuter> outer, IEnumerable <TInner> inner, Func <TOuter, TKey> outerKeySelector, Func <TInner, TKey> innerKeySelector, Func <TOuter, TInner, TResult> resultSelector, Func <TKey, TCompareKey> compareKeySelector)
 {
     return(outer.Join(inner, outerKeySelector, innerKeySelector, resultSelector, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #6
0
        // IEqualityComparer<T>

        public static bool Contains <TSource, TCompareKey>(this IEnumerable <TSource> source, TSource value, Func <TSource, TCompareKey> compareKeySelector)
        {
            return(source.Contains(value, AnonymousComparer.Create(compareKeySelector)));
        }
Пример #7
0
 public static IEnumerable <TSource> Distinct <TSource, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(source.Distinct(AnonymousComparer.Create(compareKeySelector)));
 }
Пример #8
0
        // IComparer<T>

        public static IOrderedEnumerable <TSource> OrderBy <TSource, TKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TKey, int> compare)
        {
            return(source.OrderBy(keySelector, AnonymousComparer.Create(compare)));
        }
Пример #9
0
 public static IOrderedEnumerable <TSource> ThenByDescending <TSource, TKey>(this IOrderedEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TKey, int> compare)
 {
     return(source.ThenByDescending(keySelector, AnonymousComparer.Create(compare)));
 }
Пример #10
0
 public static IImmutableList <TSource> Replace <TSource, TCompareKey>(this IImmutableList <TSource> source, TSource oldValue, TSource newValue, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(source.Replace(oldValue, newValue, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #11
0
 public static IImmutableList <TSource> RemoveRange <TSource, TCompareKey>(this IImmutableList <TSource> source, IEnumerable <TSource> items, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(source.RemoveRange(items, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #12
0
 public static IImmutableList <TSource> Remove <TSource, TCompareKey>(this IImmutableList <TSource> source, TSource value, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(source.Remove(value, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #13
0
 public static int LastIndexOf <TSource, TCompareKey>(this IImmutableList <TSource> source, TSource item, int index, int count, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(source.LastIndexOf(item, index, count, AnonymousComparer.Create(compareKeySelector)));
 }
Пример #14
0
 public static IEnumerable <IGrouping <TKey, TElement> > GroupBy <TSource, TKey, TElement, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TSource, TElement> elementSelector, Func <TKey, TCompareKey> compareKeySelector)
 {
     return(source.GroupBy <TSource, TKey, TElement>(keySelector, elementSelector, AnonymousComparer.Create <TKey, TCompareKey>(compareKeySelector)));
 }