예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TOuter"></typeparam>
 /// <typeparam name="TInner"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TResult"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="outer"></param>
 /// <param name="inner"></param>
 /// <param name="outerKeySelector"></param>
 /// <param name="innerKeySelector"></param>
 /// <param name="resultSelector"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 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, Comparers.ProjectionEquality(compareKeySelector)));
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="first"></param>
 /// <param name="second"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 public static bool SequenceEqual <TSource, TCompareKey>(this IEnumerable <TSource> first, IEnumerable <TSource> second, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(first.SequenceEqual(second, Comparers.ProjectionEquality(compareKeySelector)));
 }
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="comparison"></param>
 /// <returns></returns>
 public static IOrderedEnumerable <TSource> ThenByDescending <TSource, TKey>(this IOrderedEnumerable <TSource> source, Func <TSource, TKey> keySelector, Comparison <TKey> comparison)
 {
     return(source.ThenByDescending(keySelector, Comparers.Comparison(comparison)));
 }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TElement"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="elementSelector"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 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(keySelector, elementSelector, Comparers.ProjectionEquality(compareKeySelector)));
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="first"></param>
 /// <param name="second"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 public static IEnumerable <TSource> Except <TSource, TCompareKey>(this IEnumerable <TSource> first, IEnumerable <TSource> second, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(first.Except(second, Comparers.ProjectionEquality(compareKeySelector)));
 }
예제 #6
0
 public static IOrderedEnumerable <TSource> ThenBy <TSource, TKey>(this IOrderedEnumerable <TSource> source, Func <TSource, TKey> keySelector, Comparison <TKey> comparison) =>
 source.ThenBy(keySelector, Comparers.Comparison(comparison));
 public static IEnumerable <TSource> Union <TSource, TCompareKey>(this IEnumerable <TSource> first, IEnumerable <TSource> second, Func <TSource, TCompareKey> compareKeySelector) =>
 first.Union(second, Comparers.ProjectionEquality(compareKeySelector));
예제 #8
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="value"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 public static bool Contains <TSource, TCompareKey>(this IEnumerable <TSource> source, TSource value, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(source.Contains(value, Comparers.ProjectionEquality(compareKeySelector)));
 }
 public static Dictionary <TKey, TElement> ToDictionary <TSource, TKey, TElement, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TSource, TElement> elementSelector, Func <TKey, TCompareKey> compareKeySelector)
     where TKey : notnull =>
 source.ToDictionary(keySelector, elementSelector, Comparers.ProjectionEquality(compareKeySelector));
 public static ILookup <TKey, TSource> ToLookup <TSource, TKey, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TCompareKey> compareKeySelector) =>
 source.ToLookup(keySelector, Comparers.ProjectionEquality(compareKeySelector));
 public static IEnumerable <IGrouping <TKey, TSource> > GroupBy <TSource, TKey, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TCompareKey> compareKeySelector) =>
 source.GroupBy(keySelector, Comparers.ProjectionEquality(compareKeySelector));
 public static IOrderedEnumerable <TSource> ThenBy <TSource, TKey>(this IOrderedEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TKey, int> compare) =>
 source.ThenBy(keySelector, Comparers.Delegate(compare));
 public static IOrderedEnumerable <TSource> OrderByDescending <TSource, TKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TKey, int> compare) =>
 source.OrderByDescending(keySelector, Comparers.Delegate(compare));
예제 #14
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 public static Dictionary <TKey, TSource> ToDictionary <TSource, TKey, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TCompareKey> compareKeySelector)
 {
     return(source.ToDictionary(keySelector, Comparers.ProjectionEquality(compareKeySelector)));
 }
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="compare"></param>
 /// <returns></returns>
 public static IOrderedEnumerable <TSource> OrderBy <TSource, TKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TKey, int> compare)
 {
     return(source.OrderBy(keySelector, Comparers.Delegate(compare)));
 }
예제 #16
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TElement"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="elementSelector"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 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, Comparers.ProjectionEquality(compareKeySelector)));
 }
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="compare"></param>
 /// <returns></returns>
 public static IOrderedEnumerable <TSource> ThenByDescending <TSource, TKey>(this IOrderedEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, TKey, int> compare)
 {
     return(source.ThenByDescending(keySelector, Comparers.Delegate(compare)));
 }
예제 #18
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 public static IEnumerable <TSource> Distinct <TSource, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TCompareKey> compareKeySelector)
 {
     return(source.Distinct(Comparers.ProjectionEquality(compareKeySelector)));
 }
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="comparison"></param>
 /// <returns></returns>
 public static IOrderedEnumerable <TSource> OrderBy <TSource, TKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Comparison <TKey> comparison)
 {
     return(source.OrderBy(keySelector, Comparers.Comparison(comparison)));
 }
예제 #20
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TSource"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TResult"></typeparam>
 /// <typeparam name="TCompareKey"></typeparam>
 /// <param name="source"></param>
 /// <param name="keySelector"></param>
 /// <param name="resultSelector"></param>
 /// <param name="compareKeySelector"></param>
 /// <returns></returns>
 public static IEnumerable <TResult> GroupBy <TSource, TKey, TResult, TCompareKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Func <TKey, IEnumerable <TSource>, TResult> resultSelector, Func <TKey, TCompareKey> compareKeySelector)
 {
     return(source.GroupBy(keySelector, resultSelector, Comparers.ProjectionEquality(compareKeySelector)));
 }
예제 #21
0
 public static IOrderedEnumerable <TSource> OrderByDescending <TSource, TKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, Comparison <TKey> comparison) =>
 source.OrderByDescending(keySelector, Comparers.Comparison(comparison));