using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; using System.Threading; using System.Threading.Tasks; namespace System.Linq { public static partial class AsyncQueryable { public static Task Aggregate(this IAsyncQueryable source, Expression> accumulator) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Aggregate(default(IAsyncQueryable), default(Expression>))), source.Expression, accumulator), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator), CancellationToken.None); #endif } public static Task Aggregate(this IAsyncQueryable source, TAccumulate seed, Expression> accumulator) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Aggregate(default(IAsyncQueryable), default(TAccumulate), default(Expression>))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator), CancellationToken.None); #endif } public static Task Aggregate(this IAsyncQueryable source, Expression> accumulator, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Aggregate(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Aggregate(this IAsyncQueryable source, TAccumulate seed, Expression> accumulator, Expression> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Aggregate(default(IAsyncQueryable), default(TAccumulate), default(Expression>), default(Expression>))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector), CancellationToken.None); #endif } public static Task Aggregate(this IAsyncQueryable source, TAccumulate seed, Expression> accumulator, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Aggregate(default(IAsyncQueryable), default(TAccumulate), default(Expression>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Aggregate(this IAsyncQueryable source, TAccumulate seed, Expression> accumulator, Expression> resultSelector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Aggregate(default(IAsyncQueryable), default(TAccumulate), default(Expression>), default(Expression>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task All(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.All(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task All(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.All(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Any(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Any(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task Any(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Any(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task Any(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Any(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Any(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Any(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable Append(this IAsyncQueryable source, TSource element) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Append(default(IAsyncQueryable), default(TSource))), source.Expression, Expression.Constant(element, typeof(TSource)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(element, typeof(TSource)))); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Average(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Average(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable> Buffer(this IAsyncQueryable source, int count) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery>(Expression.Call(InfoOf(() => AsyncQueryable.Buffer(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(count, typeof(int)))); #else return source.Provider.CreateQuery>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)))); #endif } public static IAsyncQueryable> Buffer(this IAsyncQueryable source, int count, int skip) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery>(Expression.Call(InfoOf(() => AsyncQueryable.Buffer(default(IAsyncQueryable), default(int), default(int))), source.Expression, Expression.Constant(count, typeof(int)), Expression.Constant(skip, typeof(int)))); #else return source.Provider.CreateQuery>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)), Expression.Constant(skip, typeof(int)))); #endif } public static IAsyncQueryable Cast(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Cast(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), source.Expression)); #endif } public static IAsyncQueryable Catch(this IAsyncQueryable source, Expression>> handler) { if (source == null) throw new ArgumentNullException("source"); if (handler == null) throw new ArgumentNullException("handler"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Catch(default(IAsyncQueryable), default(Expression>>))), source.Expression, handler)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TException)), source.Expression, handler)); #endif } public static IAsyncQueryable Catch(this IAsyncQueryable first, IAsyncEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Catch(default(IAsyncQueryable), default(IAsyncEnumerable))), first.Expression, GetSourceExpression(second))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second))); #endif } public static IAsyncQueryable Concat(this IAsyncQueryable first, IAsyncEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Concat(default(IAsyncQueryable), default(IAsyncEnumerable))), first.Expression, GetSourceExpression(second))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second))); #endif } public static Task Contains(this IAsyncQueryable source, TSource value) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Contains(default(IAsyncQueryable), default(TSource))), source.Expression, Expression.Constant(value, typeof(TSource))), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource))), CancellationToken.None); #endif } public static Task Contains(this IAsyncQueryable source, TSource value, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Contains(default(IAsyncQueryable), default(TSource), default(IEqualityComparer))), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #endif } public static Task Contains(this IAsyncQueryable source, TSource value, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Contains(default(IAsyncQueryable), default(TSource), default(CancellationToken))), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Contains(this IAsyncQueryable source, TSource value, IEqualityComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Contains(default(IAsyncQueryable), default(TSource), default(IEqualityComparer), default(CancellationToken))), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Count(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Count(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task Count(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Count(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Count(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Count(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task Count(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Count(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable DefaultIfEmpty(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.DefaultIfEmpty(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression)); #endif } public static IAsyncQueryable DefaultIfEmpty(this IAsyncQueryable source, TSource defaultValue) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.DefaultIfEmpty(default(IAsyncQueryable), default(TSource))), source.Expression, Expression.Constant(defaultValue, typeof(TSource)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(defaultValue, typeof(TSource)))); #endif } public static IAsyncQueryable Distinct(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Distinct(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression)); #endif } public static IAsyncQueryable Distinct(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Distinct(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector)); #endif } public static IAsyncQueryable Distinct(this IAsyncQueryable source, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Distinct(default(IAsyncQueryable), default(IEqualityComparer))), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable Distinct(this IAsyncQueryable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Distinct(default(IAsyncQueryable), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable DistinctUntilChanged(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.DistinctUntilChanged(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression)); #endif } public static IAsyncQueryable DistinctUntilChanged(this IAsyncQueryable source, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.DistinctUntilChanged(default(IAsyncQueryable), default(IEqualityComparer))), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable DistinctUntilChanged(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.DistinctUntilChanged(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector)); #endif } public static IAsyncQueryable DistinctUntilChanged(this IAsyncQueryable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.DistinctUntilChanged(default(IAsyncQueryable), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable Do(this IAsyncQueryable source, Expression> onNext) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Do(default(IAsyncQueryable), default(Expression>))), source.Expression, onNext)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext)); #endif } public static IAsyncQueryable Do(this IAsyncQueryable source, IObserver observer) { if (source == null) throw new ArgumentNullException("source"); if (observer == null) throw new ArgumentNullException("observer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Do(default(IAsyncQueryable), default(IObserver))), source.Expression, Expression.Constant(observer, typeof(IObserver)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(observer, typeof(IObserver)))); #endif } public static IAsyncQueryable Do(this IAsyncQueryable source, Expression> onNext, Action onCompleted) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); if (onCompleted == null) throw new ArgumentNullException("onCompleted"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Do(default(IAsyncQueryable), default(Expression>), default(Action))), source.Expression, onNext, Expression.Constant(onCompleted, typeof(Action)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext, Expression.Constant(onCompleted, typeof(Action)))); #endif } public static IAsyncQueryable Do(this IAsyncQueryable source, Expression> onNext, Expression> onError) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); if (onError == null) throw new ArgumentNullException("onError"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Do(default(IAsyncQueryable), default(Expression>), default(Expression>))), source.Expression, onNext, onError)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext, onError)); #endif } public static IAsyncQueryable Do(this IAsyncQueryable source, Expression> onNext, Expression> onError, Action onCompleted) { if (source == null) throw new ArgumentNullException("source"); if (onNext == null) throw new ArgumentNullException("onNext"); if (onError == null) throw new ArgumentNullException("onError"); if (onCompleted == null) throw new ArgumentNullException("onCompleted"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Do(default(IAsyncQueryable), default(Expression>), default(Expression>), default(Action))), source.Expression, onNext, onError, Expression.Constant(onCompleted, typeof(Action)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext, onError, Expression.Constant(onCompleted, typeof(Action)))); #endif } public static Task ElementAt(this IAsyncQueryable source, int index) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.ElementAt(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None); #endif } public static Task ElementAt(this IAsyncQueryable source, int index, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.ElementAt(default(IAsyncQueryable), default(int), default(CancellationToken))), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task ElementAtOrDefault(this IAsyncQueryable source, int index) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.ElementAtOrDefault(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None); #endif } public static Task ElementAtOrDefault(this IAsyncQueryable source, int index, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.ElementAtOrDefault(default(IAsyncQueryable), default(int), default(CancellationToken))), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable Except(this IAsyncQueryable first, IAsyncEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Except(default(IAsyncQueryable), default(IAsyncEnumerable))), first.Expression, GetSourceExpression(second))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second))); #endif } public static IAsyncQueryable Except(this IAsyncQueryable first, IAsyncEnumerable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Except(default(IAsyncQueryable), default(IAsyncEnumerable), default(IEqualityComparer))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable Expand(this IAsyncQueryable source, Expression>> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Expand(default(IAsyncQueryable), default(Expression>>))), source.Expression, selector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector)); #endif } public static IAsyncQueryable Finally(this IAsyncQueryable source, Action finallyAction) { if (source == null) throw new ArgumentNullException("source"); if (finallyAction == null) throw new ArgumentNullException("finallyAction"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Finally(default(IAsyncQueryable), default(Action))), source.Expression, Expression.Constant(finallyAction, typeof(Action)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(finallyAction, typeof(Action)))); #endif } public static Task First(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.First(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task First(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.First(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task First(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.First(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task First(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.First(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task FirstOrDefault(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefault(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task FirstOrDefault(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefault(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task FirstOrDefault(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefault(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task FirstOrDefault(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefault(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable> GroupBy(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector)); #else return source.Provider.CreateQuery>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector)); #endif } public static IAsyncQueryable> GroupBy(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>), default(Expression>))), source.Expression, keySelector, elementSelector)); #else return source.Provider.CreateQuery>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector)); #endif } public static IAsyncQueryable> GroupBy(this IAsyncQueryable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable GroupBy(this IAsyncQueryable source, Expression> keySelector, Expression, TResult>> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>), default(Expression, TResult>>))), source.Expression, keySelector, resultSelector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector)); #endif } public static IAsyncQueryable> GroupBy(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable GroupBy(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, Expression, TResult>> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>), default(Expression>), default(Expression, TResult>>))), source.Expression, keySelector, elementSelector, resultSelector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector)); #endif } public static IAsyncQueryable GroupBy(this IAsyncQueryable source, Expression> keySelector, Expression, TResult>> resultSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>), default(Expression, TResult>>), default(IEqualityComparer))), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable GroupBy(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, Expression, TResult>> resultSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy(default(IAsyncQueryable), default(Expression>), default(Expression>), default(Expression, TResult>>), default(IEqualityComparer))), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable GroupJoin(this IAsyncQueryable outer, IAsyncEnumerable inner, Expression> outerKeySelector, Expression> innerKeySelector, Expression, TResult>> resultSelector) { if (outer == null) throw new ArgumentNullException("outer"); if (inner == null) throw new ArgumentNullException("inner"); if (outerKeySelector == null) throw new ArgumentNullException("outerKeySelector"); if (innerKeySelector == null) throw new ArgumentNullException("innerKeySelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return outer.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin(default(IAsyncQueryable), default(IAsyncEnumerable), default(Expression>), default(Expression>), default(Expression, TResult>>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector)); #else return outer.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector)); #endif } public static IAsyncQueryable GroupJoin(this IAsyncQueryable outer, IAsyncEnumerable inner, Expression> outerKeySelector, Expression> innerKeySelector, Expression, TResult>> resultSelector, IEqualityComparer comparer) { if (outer == null) throw new ArgumentNullException("outer"); if (inner == null) throw new ArgumentNullException("inner"); if (outerKeySelector == null) throw new ArgumentNullException("outerKeySelector"); if (innerKeySelector == null) throw new ArgumentNullException("innerKeySelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return outer.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin(default(IAsyncQueryable), default(IAsyncEnumerable), default(Expression>), default(Expression>), default(Expression, TResult>>), default(IEqualityComparer))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return outer.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable IgnoreElements(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.IgnoreElements(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression)); #endif } public static IAsyncQueryable Intersect(this IAsyncQueryable first, IAsyncEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Intersect(default(IAsyncQueryable), default(IAsyncEnumerable))), first.Expression, GetSourceExpression(second))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second))); #endif } public static IAsyncQueryable Intersect(this IAsyncQueryable first, IAsyncEnumerable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Intersect(default(IAsyncQueryable), default(IAsyncEnumerable), default(IEqualityComparer))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static Task IsEmpty(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.IsEmpty(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task IsEmpty(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.IsEmpty(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable Join(this IAsyncQueryable outer, IAsyncEnumerable inner, Expression> outerKeySelector, Expression> innerKeySelector, Expression> resultSelector) { if (outer == null) throw new ArgumentNullException("outer"); if (inner == null) throw new ArgumentNullException("inner"); if (outerKeySelector == null) throw new ArgumentNullException("outerKeySelector"); if (innerKeySelector == null) throw new ArgumentNullException("innerKeySelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return outer.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Join(default(IAsyncQueryable), default(IAsyncEnumerable), default(Expression>), default(Expression>), default(Expression>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector)); #else return outer.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector)); #endif } public static IAsyncQueryable Join(this IAsyncQueryable outer, IAsyncEnumerable inner, Expression> outerKeySelector, Expression> innerKeySelector, Expression> resultSelector, IEqualityComparer comparer) { if (outer == null) throw new ArgumentNullException("outer"); if (inner == null) throw new ArgumentNullException("inner"); if (outerKeySelector == null) throw new ArgumentNullException("outerKeySelector"); if (innerKeySelector == null) throw new ArgumentNullException("innerKeySelector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return outer.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Join(default(IAsyncQueryable), default(IAsyncEnumerable), default(Expression>), default(Expression>), default(Expression>), default(IEqualityComparer))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return outer.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static Task Last(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Last(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task Last(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Last(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task Last(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Last(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Last(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Last(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task LastOrDefault(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefault(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task LastOrDefault(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefault(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task LastOrDefault(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefault(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task LastOrDefault(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefault(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task LongCount(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LongCount(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task LongCount(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LongCount(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task LongCount(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LongCount(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task LongCount(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.LongCount(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(IComparer))), source.Expression, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Max(this IAsyncQueryable source, IComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(IComparer), default(CancellationToken))), source.Expression, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Max(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Max(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> MaxBy(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MaxBy(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None); #endif } public static Task> MaxBy(this IAsyncQueryable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MaxBy(default(IAsyncQueryable), default(Expression>), default(IComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #endif } public static Task> MaxBy(this IAsyncQueryable source, Expression> keySelector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MaxBy(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> MaxBy(this IAsyncQueryable source, Expression> keySelector, IComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MaxBy(default(IAsyncQueryable), default(Expression>), default(IComparer), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(IComparer))), source.Expression, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Min(this IAsyncQueryable source, IComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(IComparer), default(CancellationToken))), source.Expression, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Min(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Min(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> MinBy(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MinBy(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None); #endif } public static Task> MinBy(this IAsyncQueryable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MinBy(default(IAsyncQueryable), default(Expression>), default(IComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer))), CancellationToken.None); #endif } public static Task> MinBy(this IAsyncQueryable source, Expression> keySelector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MinBy(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> MinBy(this IAsyncQueryable source, Expression> keySelector, IComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.MinBy(default(IAsyncQueryable), default(Expression>), default(IComparer), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable OfType(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.OfType(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TType)), source.Expression)); #endif } public static IAsyncQueryable OnErrorResumeNext(this IAsyncQueryable first, IAsyncEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.OnErrorResumeNext(default(IAsyncQueryable), default(IAsyncEnumerable))), first.Expression, GetSourceExpression(second))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second))); #endif } public static IOrderedAsyncQueryable OrderBy(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.OrderBy(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector)); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector)); #endif } public static IOrderedAsyncQueryable OrderBy(this IAsyncQueryable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.OrderBy(default(IAsyncQueryable), default(Expression>), default(IComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #endif } public static IOrderedAsyncQueryable OrderByDescending(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector)); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector)); #endif } public static IOrderedAsyncQueryable OrderByDescending(this IAsyncQueryable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending(default(IAsyncQueryable), default(Expression>), default(IComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #endif } public static IAsyncQueryable Prepend(this IAsyncQueryable source, TSource element) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Prepend(default(IAsyncQueryable), default(TSource))), source.Expression, Expression.Constant(element, typeof(TSource)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(element, typeof(TSource)))); #endif } public static IAsyncQueryable Repeat(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Repeat(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression)); #endif } public static IAsyncQueryable Repeat(this IAsyncQueryable source, int count) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Repeat(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(count, typeof(int)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)))); #endif } public static IAsyncQueryable Retry(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Retry(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression)); #endif } public static IAsyncQueryable Retry(this IAsyncQueryable source, int retryCount) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Retry(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(retryCount, typeof(int)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(retryCount, typeof(int)))); #endif } public static IAsyncQueryable Reverse(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Reverse(default(IAsyncQueryable))), source.Expression)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression)); #endif } public static IAsyncQueryable Scan(this IAsyncQueryable source, Expression> accumulator) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Scan(default(IAsyncQueryable), default(Expression>))), source.Expression, accumulator)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator)); #endif } public static IAsyncQueryable Scan(this IAsyncQueryable source, TAccumulate seed, Expression> accumulator) { if (source == null) throw new ArgumentNullException("source"); if (accumulator == null) throw new ArgumentNullException("accumulator"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Scan(default(IAsyncQueryable), default(TAccumulate), default(Expression>))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator)); #endif } public static IAsyncQueryable Select(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Select(default(IAsyncQueryable), default(Expression>))), source.Expression, selector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector)); #endif } public static IAsyncQueryable Select(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Select(default(IAsyncQueryable), default(Expression>))), source.Expression, selector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector)); #endif } public static IAsyncQueryable SelectMany(this IAsyncQueryable source, IAsyncEnumerable other) { if (source == null) throw new ArgumentNullException("source"); if (other == null) throw new ArgumentNullException("other"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany(default(IAsyncQueryable), default(IAsyncEnumerable))), source.Expression, GetSourceExpression(other))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)), source.Expression, GetSourceExpression(other))); #endif } public static IAsyncQueryable SelectMany(this IAsyncQueryable source, Expression>> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany(default(IAsyncQueryable), default(Expression>>))), source.Expression, selector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector)); #endif } public static IAsyncQueryable SelectMany(this IAsyncQueryable source, Expression>> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany(default(IAsyncQueryable), default(Expression>>))), source.Expression, selector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector)); #endif } public static IAsyncQueryable SelectMany(this IAsyncQueryable source, Expression>> selector, Expression> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany(default(IAsyncQueryable), default(Expression>>), default(Expression>))), source.Expression, selector, resultSelector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector)); #endif } public static IAsyncQueryable SelectMany(this IAsyncQueryable source, Expression>> selector, Expression> resultSelector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); if (resultSelector == null) throw new ArgumentNullException("resultSelector"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany(default(IAsyncQueryable), default(Expression>>), default(Expression>))), source.Expression, selector, resultSelector)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector)); #endif } public static Task SequenceEqual(this IAsyncQueryable first, IAsyncEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqual(default(IAsyncQueryable), default(IAsyncEnumerable))), first.Expression, GetSourceExpression(second)), CancellationToken.None); #else return first.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)), CancellationToken.None); #endif } public static Task SequenceEqual(this IAsyncQueryable first, IAsyncEnumerable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return first.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqual(default(IAsyncQueryable), default(IAsyncEnumerable), default(IEqualityComparer))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #else return first.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #endif } public static Task SequenceEqual(this IAsyncQueryable first, IAsyncEnumerable second, CancellationToken cancellationToken) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqual(default(IAsyncQueryable), default(IAsyncEnumerable), default(CancellationToken))), first.Expression, GetSourceExpression(second), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return first.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task SequenceEqual(this IAsyncQueryable first, IAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return first.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqual(default(IAsyncQueryable), default(IAsyncEnumerable), default(IEqualityComparer), default(CancellationToken))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return first.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Single(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Single(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task Single(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Single(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task Single(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Single(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Single(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Single(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task SingleOrDefault(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefault(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task SingleOrDefault(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefault(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None); #endif } public static Task SingleOrDefault(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefault(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task SingleOrDefault(this IAsyncQueryable source, Expression> predicate, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefault(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable Skip(this IAsyncQueryable source, int count) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Skip(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(count, typeof(int)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)))); #endif } public static IAsyncQueryable SkipLast(this IAsyncQueryable source, int count) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SkipLast(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(count, typeof(int)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)))); #endif } public static IAsyncQueryable SkipWhile(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate)); #endif } public static IAsyncQueryable SkipWhile(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate)); #endif } public static IAsyncQueryable StartWith(this IAsyncQueryable source, params TSource[] values) { if (source == null) throw new ArgumentNullException("source"); if (values == null) throw new ArgumentNullException("values"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.StartWith(default(IAsyncQueryable), default(TSource[]))), source.Expression, Expression.Constant(values, typeof(TSource[])))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(values, typeof(TSource[])))); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>))), source.Expression, selector), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task Sum(this IAsyncQueryable source, Expression> selector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.Sum(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable Take(this IAsyncQueryable source, int count) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Take(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(count, typeof(int)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)))); #endif } public static IAsyncQueryable TakeLast(this IAsyncQueryable source, int count) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.TakeLast(default(IAsyncQueryable), default(int))), source.Expression, Expression.Constant(count, typeof(int)))); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)))); #endif } public static IAsyncQueryable TakeWhile(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate)); #endif } public static IAsyncQueryable TakeWhile(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate)); #endif } public static IOrderedAsyncQueryable ThenBy(this IOrderedAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy(default(IOrderedAsyncQueryable), default(Expression>))), source.Expression, keySelector)); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector)); #endif } public static IOrderedAsyncQueryable ThenBy(this IOrderedAsyncQueryable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy(default(IOrderedAsyncQueryable), default(Expression>), default(IComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #endif } public static IOrderedAsyncQueryable ThenByDescending(this IOrderedAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending(default(IOrderedAsyncQueryable), default(Expression>))), source.Expression, keySelector)); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector)); #endif } public static IOrderedAsyncQueryable ThenByDescending(this IOrderedAsyncQueryable source, Expression> keySelector, IComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending(default(IOrderedAsyncQueryable), default(Expression>), default(IComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #else return (IOrderedAsyncQueryable)source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer)))); #endif } public static Task ToArray(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.ToArray(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task ToArray(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync(Expression.Call(InfoOf(() => AsyncQueryable.ToArray(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>), default(Expression>))), source.Expression, keySelector, elementSelector), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>), default(Expression>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>), default(IEqualityComparer), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #endif } public static Task> ToDictionary(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionary(default(IAsyncQueryable), default(Expression>), default(Expression>), default(IEqualityComparer), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToList(this IAsyncQueryable source) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToList(default(IAsyncQueryable))), source.Expression), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None); #endif } public static Task> ToList(this IAsyncQueryable source, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToList(default(IAsyncQueryable), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>))), source.Expression, keySelector), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>), default(Expression>))), source.Expression, keySelector, elementSelector), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>), default(Expression>), default(IEqualityComparer))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer))), CancellationToken.None); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>), default(Expression>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>), default(IEqualityComparer), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static Task> ToLookup(this IAsyncQueryable source, Expression> keySelector, Expression> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { if (source == null) throw new ArgumentNullException("source"); if (keySelector == null) throw new ArgumentNullException("keySelector"); if (elementSelector == null) throw new ArgumentNullException("elementSelector"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return source.Provider.ExecuteAsync>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookup(default(IAsyncQueryable), default(Expression>), default(Expression>), default(IEqualityComparer), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #else return source.Provider.ExecuteAsync>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken); #endif } public static IAsyncQueryable Union(this IAsyncQueryable first, IAsyncEnumerable second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Union(default(IAsyncQueryable), default(IAsyncEnumerable))), first.Expression, GetSourceExpression(second))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second))); #endif } public static IAsyncQueryable Union(this IAsyncQueryable first, IAsyncEnumerable second, IEqualityComparer comparer) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (comparer == null) throw new ArgumentNullException("comparer"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Union(default(IAsyncQueryable), default(IAsyncEnumerable), default(IEqualityComparer))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)))); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer)))); #endif } public static IAsyncQueryable Where(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Where(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate)); #endif } public static IAsyncQueryable Where(this IAsyncQueryable source, Expression> predicate) { if (source == null) throw new ArgumentNullException("source"); if (predicate == null) throw new ArgumentNullException("predicate"); #if CRIPPLED_REFLECTION return source.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Where(default(IAsyncQueryable), default(Expression>))), source.Expression, predicate)); #else return source.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate)); #endif } public static IAsyncQueryable Zip(this IAsyncQueryable first, IAsyncEnumerable second, Expression> selector) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); if (selector == null) throw new ArgumentNullException("selector"); #if CRIPPLED_REFLECTION return first.Provider.CreateQuery(Expression.Call(InfoOf(() => AsyncQueryable.Zip(default(IAsyncQueryable), default(IAsyncEnumerable), default(Expression>))), first.Expression, GetSourceExpression(second), selector)); #else return first.Provider.CreateQuery(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond), typeof(TResult)), first.Expression, GetSourceExpression(second), selector)); #endif } } }