public static double Average(this IQueryable <int> source) { Check.Source(source); return(source.Provider.Execute <double>(StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression))); }
public static decimal?Sum(this IQueryable <decimal?> source) { Check.Source(source); return(source.Provider.Execute <decimal?>(StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression))); }
public static IQueryable <TSource> Take <TSource>(this IQueryable <TSource> source, int count) { Check.Source(source); return(source.Provider.CreateQuery <TSource>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource)), source.Expression, Expression.Constant(count)))); }
public static IQueryable <TSource> Reverse <TSource>(this IQueryable <TSource> source) { Check.Source(source); return(source.Provider.CreateQuery <TSource>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource)), source.Expression))); }
public static TSource SingleOrDefault <TSource>(this IQueryable <TSource> source) { Check.Source(source); return(source.Provider.Execute <TSource>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource)), source.Expression))); }
public static TResult Max <TSource, TResult>(this IQueryable <TSource> source, Expression <Func <TSource, TResult> > selector) { Check.Source(source); return(source.Provider.Execute <TResult>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource), typeof(TResult)), source.Expression, Expression.Quote(selector)))); }
public static IQueryable <TResult> OfType <TResult>(this IQueryable source) { Check.Source(source); return((IQueryable <TResult>)source.Provider.CreateQuery(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TResult)), source.Expression))); }
public static long LongCount <TSource>(this IQueryable <TSource> source) { Check.Source(source); return(source.Execute <long, TSource>(MethodBase.GetCurrentMethod())); }
public static TSource ElementAtOrDefault <TSource>(this IQueryable <TSource> source, int index) { Check.Source(source); return(source.Provider.Execute <TSource>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource)), source.Expression, Expression.Constant(index)))); }
public static IQueryable <TSource> Distinct <TSource>(this IQueryable <TSource> source, IEqualityComparer <TSource> comparer) { Check.Source(source); return(source.Provider.CreateQuery <TSource>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource)), source.Expression, Expression.Constant(comparer)))); }
public static IQueryable <TSource> DefaultIfEmpty <TSource>(this IQueryable <TSource> source, TSource defaultValue) { Check.Source(source); return(source.Provider.CreateQuery <TSource>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource)), source.Expression, Expression.Constant(defaultValue)))); }
public static bool Contains <TSource>(this IQueryable <TSource> source, TSource item, IEqualityComparer <TSource> comparer) { Check.Source(source); return(source.Provider.Execute <bool>(StaticCall(MakeGeneric(MethodBase.GetCurrentMethod(), typeof(TSource)), source.Expression, Expression.Constant(item), Expression.Constant(comparer)))); }