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)))); }
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)))); }
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)))); }