示例#1
0
 public static IOrderedQueryable <TSource> OrderBy <TSource, TKey>(this IQueryable <TSource> source, Expression <Func <TSource, TKey> > keySelector)
 {
     Check.SourceAndKeySelector(source, keySelector);
     return((IOrderedQueryable <TSource>)source.Provider.CreateQuery <TSource>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource), typeof(TKey)), source.Expression, Expression.Quote(keySelector))));
 }
示例#2
0
 public static IOrderedQueryable <TSource> ThenByDescending <TSource, TKey>(this IOrderedQueryable <TSource> source, Expression <Func <TSource, TKey> > keySelector, IComparer <TKey> comparer)
 {
     Check.SourceAndKeySelector(source, keySelector);
     return((IOrderedQueryable <TSource>)source.Provider.CreateQuery(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource), typeof(TKey)), source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer))));
 }
示例#3
0
 public static IQueryable <IGrouping <TKey, TSource> > GroupBy <TSource, TKey>(this IQueryable <TSource> source, Expression <Func <TSource, TKey> > keySelector, IEqualityComparer <TKey> comparer)
 {
     Check.SourceAndKeySelector(source, keySelector);
     return(source.Provider.CreateQuery <IGrouping <TKey, TSource> >(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource), typeof(TKey)), source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer))));
 }