コード例 #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)));
 }