示例#1
0
 public static double Average(this IQueryable <int> source)
 {
     Check.Source(source);
     return(source.Provider.Execute <double>(StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression)));
 }
示例#2
0
 public static decimal?Sum(this IQueryable <decimal?> source)
 {
     Check.Source(source);
     return(source.Provider.Execute <decimal?>(StaticCall((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression)));
 }
示例#3
0
 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))));
 }
示例#4
0
 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)));
 }
示例#5
0
 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)));
 }
示例#6
0
 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))));
 }
示例#7
0
 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)));
 }
示例#8
0
 public static long LongCount <TSource>(this IQueryable <TSource> source)
 {
     Check.Source(source);
     return(source.Execute <long, TSource>(MethodBase.GetCurrentMethod()));
 }
示例#9
0
 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))));
 }
示例#10
0
 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))));
 }
示例#11
0
 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))));
 }
示例#12
0
 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))));
 }