예제 #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))));
 }