Browse Source

Adding IAsyncQueryable<T> support.

Bart De Smet 10 years ago
parent
commit
b81b8090c7

+ 35 - 1
Ix.NET/Source/Interactive Extensions.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.22512.0
+VisualStudioVersion = 14.0.23107.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Interactive", "System.Interactive\System.Interactive.csproj", "{8E4B04F0-915E-48F9-9796-76278C6094BD}"
 EndProject
@@ -20,6 +20,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Interactive.Async",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground", "Playground\Playground.csproj", "{45817D7B-A707-497B-89D3-37794B6E46C7}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Interactive.Async.Providers", "System.Interactive.Async.Providers\System.Interactive.Async.Providers.csproj", "{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -190,6 +192,38 @@ Global
 		{45817D7B-A707-497B-89D3-37794B6E46C7}.ReleaseWP7|Any CPU.Build.0 = Release|Any CPU
 		{45817D7B-A707-497B-89D3-37794B6E46C7}.ReleaseWP8|Any CPU.ActiveCfg = Release|Any CPU
 		{45817D7B-A707-497B-89D3-37794B6E46C7}.ReleaseWP8|Any CPU.Build.0 = Release|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug|Any CPU.ActiveCfg = DebugWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug|Any CPU.Build.0 = DebugWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug35|Any CPU.ActiveCfg = Debug35|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug35|Any CPU.Build.0 = Debug35|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug40|Any CPU.ActiveCfg = Debug40|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug40|Any CPU.Build.0 = Debug40|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug45|Any CPU.ActiveCfg = Debug45|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Debug45|Any CPU.Build.0 = Debug45|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugPL|Any CPU.ActiveCfg = DebugPL|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugPL|Any CPU.Build.0 = DebugPL|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugSL5|Any CPU.ActiveCfg = DebugSL5|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugSL5|Any CPU.Build.0 = DebugSL5|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugWP7|Any CPU.ActiveCfg = DebugWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugWP7|Any CPU.Build.0 = DebugWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugWP8|Any CPU.ActiveCfg = DebugWP8|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.DebugWP8|Any CPU.Build.0 = DebugWP8|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release|Any CPU.ActiveCfg = ReleaseWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release|Any CPU.Build.0 = ReleaseWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release35|Any CPU.ActiveCfg = Release35|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release35|Any CPU.Build.0 = Release35|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release40|Any CPU.ActiveCfg = Release40|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release40|Any CPU.Build.0 = Release40|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release45|Any CPU.ActiveCfg = Release45|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.Release45|Any CPU.Build.0 = Release45|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleasePL|Any CPU.ActiveCfg = ReleasePL|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleasePL|Any CPU.Build.0 = ReleasePL|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleaseSL5|Any CPU.ActiveCfg = ReleaseSL5|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleaseSL5|Any CPU.Build.0 = ReleaseSL5|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleaseWP7|Any CPU.ActiveCfg = ReleaseWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleaseWP7|Any CPU.Build.0 = ReleaseWP7|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleaseWP8|Any CPU.ActiveCfg = ReleaseWP8|Any CPU
+		{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}.ReleaseWP8|Any CPU.Build.0 = ReleaseWP8|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 42 - 0
Ix.NET/Source/System.Interactive.Async.Providers/AsyncEnumerableExecutor.cs

@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+using System.Linq.Expressions;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Linq
+{
+    /// <summary>
+    /// Provides functionality to evaluate an expression tree representation of a computation over asynchronous enumerable sequences.
+    /// </summary>
+    /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+    internal class AsyncEnumerableExecutor<T>
+    {
+        private readonly Expression _expression;
+        private Func<CancellationToken, Task<T>> _func;
+
+        /// <summary>
+        /// Creates a new execution helper instance for the specified expression tree representing a computation over asynchronous enumerable sequences.
+        /// </summary>
+        /// <param name="expression">Expression tree representing a computation over asynchronous enumerable sequences.</param>
+        public AsyncEnumerableExecutor(Expression expression)
+        {
+            _expression = expression;
+        }
+
+        /// <summary>
+        /// Evaluated the expression tree.
+        /// </summary>
+        /// <param name="token">Token to cancel the evaluation.</param>
+        /// <returns>Task representing the evaluation of the expression tree.</returns>
+        internal Task<T> ExecuteAsync(CancellationToken token)
+        {
+            if (_func == null)
+            {
+                var expression = Expression.Lambda<Func<CancellationToken, Task<T>>>(new AsyncEnumerableRewriter().Visit(_expression), Expression.Parameter(typeof(CancellationToken)));
+                _func = expression.Compile();
+            }
+
+            return _func(token);
+        }
+    }
+}

+ 176 - 0
Ix.NET/Source/System.Interactive.Async.Providers/AsyncEnumerableQuery.cs

@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Linq
+{
+    /// <summary>
+    /// Representation of an asynchronous enumerable sequence using an expression tree.
+    /// </summary>
+    internal abstract class AsyncEnumerableQuery
+    {
+        /// <summary>
+        /// Gets the enumerable sequence obtained from evaluating the expression tree.
+        /// </summary>
+        internal abstract object Enumerable { get; } // TODO: non-generic interface?
+
+        /// <summary>
+        /// Gets the expression tree representing the asynchronous enumerable sequence.
+        /// </summary>
+        internal abstract Expression Expression { get; }
+    }
+
+    /// <summary>
+    /// Representation of an asynchronous enumerable sequence using an expression tree.
+    /// </summary>
+    /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+    internal class AsyncEnumerableQuery<T> : AsyncEnumerableQuery, IOrderedAsyncQueryable<T>, IAsyncQueryProvider
+    {
+        private readonly Expression _expression;
+        private IAsyncEnumerable<T> _enumerable;
+
+        /// <summary>
+        /// Creates a new asynchronous enumerable sequence represented by the specified expression tree.
+        /// </summary>
+        /// <param name="expression">The expression tree representing the asynchronous enumerable sequence.</param>
+        public AsyncEnumerableQuery(Expression expression)
+        {
+            _expression = expression;
+        }
+
+        /// <summary>
+        /// Creates a new asynchronous enumerable sequence by wrapping the specified sequence in an expression tree representation.
+        /// </summary>
+        /// <param name="enumerable">The asynchronous enumerable sequence to represent using an expression tree.</param>
+        public AsyncEnumerableQuery(IAsyncEnumerable<T> enumerable)
+        {
+            _enumerable = enumerable;
+            _expression = Expression.Constant(this);
+        }
+
+        /// <summary>
+        /// Gets the type of the elements in the sequence.
+        /// </summary>
+        Type IAsyncQueryable.ElementType
+        {
+            get
+            {
+                return typeof(T);
+            }
+        }
+
+        /// <summary>
+        /// Gets the expression representing the sequence.
+        /// </summary>
+        Expression IAsyncQueryable.Expression
+        {
+            get
+            {
+                return _expression;
+            }
+        }
+
+        /// <summary>
+        /// Gets the query provider used to execute the sequence.
+        /// </summary>
+        IAsyncQueryProvider IAsyncQueryable.Provider
+        {
+            get
+            {
+                return this;
+            }
+        }
+
+        /// <summary>
+        /// Gets the enumerable sequence obtained from evaluating the expression tree.
+        /// </summary>
+        internal override object Enumerable
+        {
+            get
+            {
+                return _enumerable;
+            }
+        }
+
+        /// <summary>
+        /// Gets the expression tree representing the asynchronous enumerable sequence.
+        /// </summary>
+        internal override Expression Expression
+        {
+            get
+            {
+                return _expression;
+            }
+        }
+
+        /// <summary>
+        /// Creates a new asynchronous enumerable sequence represented by an expression tree.
+        /// </summary>
+        /// <typeparam name="TElement">The type of the elements in the sequence.</typeparam>
+        /// <param name="expression">The expression tree representing the asynchronous enumerable sequence.</param>
+        /// <returns>Asynchronous enumerable sequence represented by the specified expression tree.</returns>
+        IAsyncQueryable<TElement> IAsyncQueryProvider.CreateQuery<TElement>(Expression expression)
+        {
+            return new AsyncEnumerableQuery<TElement>(expression);
+        }
+
+        /// <summary>
+        /// Executes an expression tree representing a computation over asynchronous enumerable sequences.
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result of evaluating the expression tree.</typeparam>
+        /// <param name="expression">The expression tree to evaluate.</param>
+        /// <param name="token">Cancellation token used to cancel the evaluation.</param>
+        /// <returns>Task representing the result of evaluating the specified expression tree.</returns>
+        Task<TResult> IAsyncQueryProvider.ExecuteAsync<TResult>(Expression expression, CancellationToken token)
+        {
+            if (expression == null)
+            {
+                throw new ArgumentNullException("expression");
+            }
+
+            if (!typeof(Task<TResult>).IsAssignableFrom(expression.Type))
+            {
+                throw new ArgumentException("The specified expression is not assignable to the result type.", "expression");
+            }
+
+            return new AsyncEnumerableExecutor<TResult>(expression).ExecuteAsync(token);
+        }
+
+        /// <summary>
+        /// Gets an enumerator to enumerate the elements in the sequence.
+        /// </summary>
+        /// <returns>A new enumerator instance used to enumerate the elements in the sequence.</returns>
+        public IAsyncEnumerator<T> GetEnumerator()
+        {
+            if (_enumerable == null)
+            {
+                var expression = Expression.Lambda<Func<IAsyncEnumerable<T>>>(new AsyncEnumerableRewriter().Visit(_expression), null);
+                _enumerable = expression.Compile()();
+            }
+
+            return _enumerable.GetEnumerator();
+        }
+
+        /// <summary>
+        /// Gets a string representation of the enumerable sequence.
+        /// </summary>
+        /// <returns>String representation of the enumerable sequence.</returns>
+        public override string ToString()
+        {
+            var ce = _expression as ConstantExpression;
+            if (ce == null || ce.Value != this)
+            {
+                return _expression.ToString();
+            }
+
+            if (_enumerable != null)
+            {
+                return _enumerable.ToString();
+            }
+
+            return "null";
+        }
+    }
+}

+ 487 - 0
Ix.NET/Source/System.Interactive.Async.Providers/AsyncEnumerableRewriter.cs

@@ -0,0 +1,487 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Globalization;
+using System.Linq.Expressions;
+using System.Reflection;
+
+namespace System.Linq
+{
+    /// <summary>
+    /// Rewrites an expression tree representation using AsyncQueryable methods to the corresponding AsyncEnumerable equivalents.
+    /// </summary>
+    internal class AsyncEnumerableRewriter : ExpressionVisitor
+    {
+        private static volatile ILookup<string, MethodInfo> s_methods;
+
+        protected override Expression VisitConstant(ConstantExpression node)
+        {
+            var enumerableQuery = node.Value as AsyncEnumerableQuery;
+
+            //
+            // Not an expression representation obtained from the async enumerable query provider,
+            // so just a plain constant that can be returned as-is.
+            //
+            if (enumerableQuery == null)
+            {
+                return node;
+            }
+
+            //
+            // Expression representation obtained from the async enumerable query provider, so first
+            // check whether it wraps an enumerable sequence that has been evaluated already.
+            //
+            if (enumerableQuery.Enumerable != null)
+            {
+                var publicType = GetPublicType(enumerableQuery.Enumerable.GetType());
+                return Expression.Constant(enumerableQuery.Enumerable, publicType);
+            }
+
+            //
+            // If not evaluated yet, inline the expression representation.
+            //
+            return Visit(enumerableQuery.Expression);
+        }
+
+        protected override Expression VisitMethodCall(MethodCallExpression node)
+        {
+            var obj = Visit(node.Object);
+            var args = Visit(node.Arguments);
+
+            //
+            // Nothing changed during the visit; just some unrelated method call that can
+            // be returned as-is.
+            //
+            if (obj == node.Object && args == node.Arguments)
+            {
+                return node;
+            }
+
+            var typeArgs = node.Method.IsGenericMethod ? node.Method.GetGenericArguments() : null;
+
+            //
+            // Check whether the method is compatible with the recursively rewritten instance
+            // and arguments expressions. If so, create a new call expression.
+            //
+            if ((node.Method.IsStatic || node.Method.DeclaringType.IsAssignableFrom(obj.Type)) && ArgsMatch(node.Method, args, typeArgs))
+            {
+                return Expression.Call(obj, node.Method, args);
+            }
+
+            var method = default(MethodInfo);
+
+            //
+            // Find a corresponding method in the non-expression world, e.g. rewriting from
+            // the AsyncQueryable methods to the ones on AsyncEnumerable.
+            //
+            if (node.Method.DeclaringType == typeof(AsyncQueryable))
+            {
+                method = FindEnumerableMethod(node.Method.Name, args, typeArgs);
+                args = FixupQuotedArgs(method, args);
+                return Expression.Call(obj, method, args);
+            }
+            else
+            {
+                method = FindMethod(node.Method.DeclaringType, node.Method.Name, args, typeArgs, BindingFlags.Static | (node.Method.IsPublic ? BindingFlags.Public : BindingFlags.NonPublic));
+                args = FixupQuotedArgs(method, args);
+            }
+
+            return Expression.Call(obj, method, args);
+        }
+
+        protected override Expression VisitLambda<T>(Expression<T> node)
+        {
+            //
+            // Don't recurse into lambdas; all the ones returning IAsyncQueryable<T>
+            // are compatible with their IAsyncEnumerable<T> counterparts due to the
+            // covariant return type.
+            //
+            return node;
+        }
+
+        protected override Expression VisitParameter(ParameterExpression node)
+        {
+            //
+            // See remark on VisitLambda.
+            //
+            return node;
+        }
+
+        private static Type GetPublicType(Type type)
+        {
+            if (!type.IsNestedPrivate)
+            {
+                return type;
+            }
+
+            foreach (var ifType in type.GetInterfaces())
+            {
+                if (ifType.IsGenericType)
+                {
+                    var def = ifType.GetGenericTypeDefinition();
+                    if (def == typeof(IAsyncEnumerable<>) || def == typeof(IAsyncGrouping<,>))
+                    {
+                        return ifType;
+                    }
+                }
+            }
+
+            //
+            // TODO: non-generic interface needed?
+            //
+            //if (typeof(IAsyncEnumerable).IsAssignableFrom(type))
+            //{
+            //    return typeof(IAsyncEnumerable);
+            //}
+
+            return type;
+        }
+
+        private static bool ArgsMatch(MethodInfo method, ReadOnlyCollection<Expression> args, Type[] typeArgs)
+        {
+            //
+            // Number of parameters should match the number of arguments to bind.
+            //
+            var parameters = method.GetParameters();
+            if (parameters.Length != args.Count)
+            {
+                return false;
+            }
+
+            //
+            // Both should be generic or non-generic.
+            //
+            if (!method.IsGenericMethod && typeArgs != null && typeArgs.Length != 0)
+            {
+                return false;
+            }
+
+            //
+            // Closed generic methods need to get converted to their open generic counterpart.
+            //
+            if (!method.IsGenericMethodDefinition && method.IsGenericMethod && method.ContainsGenericParameters)
+            {
+                method = method.GetGenericMethodDefinition();
+            }
+
+            //
+            // For generic methods, close the candidate using the specified type arguments.
+            //
+            if (method.IsGenericMethodDefinition)
+            {
+                //
+                // We should have at least 1 type argument.
+                //
+                if (typeArgs == null || typeArgs.Length == 0)
+                {
+                    return false;
+                }
+
+                //
+                // The number of type arguments needed should match the specified type argument count.
+                //
+                if (method.GetGenericArguments().Length != typeArgs.Length)
+                {
+                    return false;
+                }
+
+                //
+                // Close the generic method and re-obtain the parameters.
+                //
+                method = method.MakeGenericMethod(typeArgs);
+                parameters = method.GetParameters();
+            }
+
+            //
+            // Check for contravariant assignability of each parameter.
+            //
+            for (var i = 0; i < args.Count; i++)
+            {
+                var type = parameters[i].ParameterType;
+
+                //
+                // Hardening against reflection quirks.
+                //
+                if (type == null)
+                {
+                    return false;
+                }
+
+                //
+                // Deal with ref or out parameters by using the element type which can
+                // match the corresponding expression type (ref passing is not encoded
+                // in the type of expression trees).
+                //
+                if (type.IsByRef)
+                {
+                    type = type.GetElementType();
+                }
+
+                var expression = args[i];
+
+                //
+                // If the expression is assignable to the parameter, all is good. If not,
+                // it's possible there's a match because we're dealing with a quote that
+                // needs to be unpacked.
+                //
+                if (!type.IsAssignableFrom(expression.Type))
+                {
+                    //
+                    // Unpack the quote, if any. See AsyncQueryable for examples of operators
+                    // that hit this case.
+                    //
+                    if (expression.NodeType == ExpressionType.Quote)
+                    {
+                        expression = ((UnaryExpression)expression).Operand;
+                    }
+
+                    //
+                    // Try assigning the raw expression type or the quote-free expression type
+                    // to the parameter. If none of these work, there's no match.
+                    //
+                    if (!type.IsAssignableFrom(expression.Type) && !type.IsAssignableFrom(StripExpression(expression.Type)))
+                    {
+                        return false;
+                    }
+                }
+            }
+
+            return true;
+        }
+
+        private ReadOnlyCollection<Expression> FixupQuotedArgs(MethodInfo method, ReadOnlyCollection<Expression> argList)
+        {
+            //
+            // Get all of the method parameters. No fix-up needed if empty.
+            //
+            var parameters = method.GetParameters();
+            if (parameters.Length != 0)
+            {
+                var list = default(List<Expression>);
+
+                //
+                // Process all parameters. If any fixup is needed, the list will
+                // get assigned.
+                //
+                for (var i = 0; i < parameters.Length; i++)
+                {
+                    var expression = argList[i];
+                    var parameterInfo = parameters[i];
+
+                    //
+                    // Perform the fix-up if needed and check the outcome. If a
+                    // change was made, the list is lazily allocated.
+                    //
+                    expression = FixupQuotedExpression(parameterInfo.ParameterType, expression);
+
+                    if (list == null && expression != argList[i])
+                    {
+                        list = new List<Expression>(argList.Count);
+
+                        for (var j = 0; j < i; j++)
+                        {
+                            list.Add(argList[j]);
+                        }
+                    }
+
+                    if (list != null)
+                    {
+                        list.Add(expression);
+                    }
+                }
+
+                //
+                // If any argument was fixed up, return a new argument list.
+                //
+                if (list != null)
+                {
+                    argList = new ReadOnlyCollection<Expression>(list);
+                }
+            }
+
+            return argList;
+        }
+
+        private Expression FixupQuotedExpression(Type type, Expression expression)
+        {
+            var res = expression;
+
+            //
+            // Keep unquoting until assignability checks pass.
+            //
+            while (!type.IsAssignableFrom(res.Type))
+            {
+                //
+                // In case this is not a quote, bail out early.
+                //
+                if (res.NodeType != ExpressionType.Quote)
+                {
+                    //
+                    // Array initialization expressions need special care by unquoting the elements.
+                    //
+                    if (!type.IsAssignableFrom(res.Type) && type.IsArray && res.NodeType == ExpressionType.NewArrayInit)
+                    {
+                        var unquotedType = StripExpression(res.Type);
+                        if (type.IsAssignableFrom(unquotedType))
+                        {
+                            var newArrayExpression = (NewArrayExpression)res;
+
+                            var count = newArrayExpression.Expressions.Count;
+                            var elementType = type.GetElementType();
+                            var list = new List<Expression>(count);
+
+                            for (var i = 0; i < count; i++)
+                            {
+                                list.Add(FixupQuotedExpression(elementType, newArrayExpression.Expressions[i]));
+                            }
+
+                            expression = Expression.NewArrayInit(elementType, list);
+                        }
+                    }
+
+                    return expression;
+                }
+
+                //
+                // Unquote and try again; at most two passes should be needed.
+                //
+                res = ((UnaryExpression)res).Operand;
+            }
+
+            return res;
+        }
+
+        private static Type StripExpression(Type type)
+        {
+            //
+            // Array of quotes need to be stripped, so extract the element type.
+            //
+            var elemType = type.IsArray ? type.GetElementType() : type;
+
+            //
+            // Try to find Expression<T> and obtain T.
+            //
+            var genType = FindGenericType(typeof(Expression<>), elemType);
+            if (genType != null)
+            {
+                elemType = genType.GetGenericArguments()[0];
+            }
+
+            //
+            // Not an array, nothing to do here.
+            //
+            if (!type.IsArray)
+            {
+                return type;
+            }
+
+            //
+            // Reconstruct the array type from the stripped element type.
+            //
+            var arrayRank = type.GetArrayRank();
+            if (arrayRank != 1)
+            {
+                return elemType.MakeArrayType(arrayRank);
+            }
+
+            return elemType.MakeArrayType();
+        }
+
+        private static MethodInfo FindEnumerableMethod(string name, ReadOnlyCollection<Expression> args, params Type[] typeArgs)
+        {
+            //
+            // Ensure the cached lookup table for AsyncEnumerable methods is initialized.
+            //
+            if (s_methods == null)
+            {
+                s_methods = typeof(AsyncEnumerable).GetMethods(BindingFlags.Static | BindingFlags.Public).ToLookup(m => m.Name);
+            }
+
+            //
+            // Find a match based on the method name and the argument types.
+            //
+            var method = s_methods[name].FirstOrDefault(m => ArgsMatch(m, args, typeArgs));
+            if (method == null)
+            {
+                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Could not find method with name '{0}' on type '{1}'.", name, typeof(Enumerable)));
+            }
+
+            //
+            // Close the generic method if needed.
+            //
+            if (typeArgs != null)
+            {
+                return method.MakeGenericMethod(typeArgs);
+            }
+
+            return method;
+        }
+
+        private static MethodInfo FindMethod(Type type, string name, ReadOnlyCollection<Expression> args, Type[] typeArgs, BindingFlags flags)
+        {
+            //
+            // Get all the candidates based on name and fail if none are found.
+            //
+            var methods = type.GetMethods(flags).Where(m => m.Name == name).ToArray();
+            if (methods.Length == 0)
+            {
+                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Could not find method with name '{0}' on type '{1}'.", name, type));
+            }
+
+            //
+            // Find a match based on arguments and fail if no match is found.
+            //
+            var method = methods.FirstOrDefault(m => ArgsMatch(m, args, typeArgs));
+            if (method == null)
+            {
+                throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Could not find a matching method with name '{0}' on type '{1}'.", name, type));
+            }
+
+            //
+            // Close the generic method if needed.
+            //
+            if (typeArgs != null)
+            {
+                return method.MakeGenericMethod(typeArgs);
+            }
+
+            return method;
+        }
+
+        private static Type FindGenericType(Type definition, Type type)
+        {
+            while (type != null && type != typeof(object))
+            {
+                //
+                // If the current type matches the specified definition, return.
+                //
+                if (type.IsGenericType && type.GetGenericTypeDefinition() == definition)
+                {
+                    return type;
+                }
+
+                //
+                // Probe all interfaces implemented by the current type.
+                //
+                if (definition.IsInterface)
+                {
+                    foreach (var ifType in type.GetInterfaces())
+                    {
+                        var res = FindGenericType(definition, ifType);
+                        if (res != null)
+                        {
+                            return res;
+                        }
+                    }
+                }
+
+                //
+                // Continue up the type hierarchy.
+                //
+                type = type.BaseType;
+            }
+
+            return null;
+        }
+    }
+}

+ 3241 - 0
Ix.NET/Source/System.Interactive.Async.Providers/AsyncQueryable.Generated.cs

@@ -0,0 +1,3241 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+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<TSource> Aggregate<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> accumulator)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator), CancellationToken.None);
+		}
+
+		public static Task<TSource> Aggregate<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> accumulator, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TAccumulate> Aggregate<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+
+			return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator), CancellationToken.None);
+		}
+
+		public static Task<TAccumulate> Aggregate<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+
+			return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TResult> Aggregate<TSource, TAccumulate, TResult>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator, Expression<Func<TAccumulate, TResult>> resultSelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+			if (resultSelector == null)
+				throw new ArgumentNullException("resultSelector");
+
+			return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector), CancellationToken.None);
+		}
+
+		public static Task<TResult> Aggregate<TSource, TAccumulate, TResult>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator, Expression<Func<TAccumulate, TResult>> resultSelector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+			if (resultSelector == null)
+				throw new ArgumentNullException("resultSelector");
+
+			return source.Provider.ExecuteAsync<TResult>(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);
+		}
+
+		public static Task<bool> All<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<bool> All<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<bool> Any<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<bool> Any<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<bool> Any<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<bool> Any<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Average(this IAsyncQueryable<int> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double?> Average(this IAsyncQueryable<int?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double> Average(this IAsyncQueryable<long> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double?> Average(this IAsyncQueryable<long?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double> Average(this IAsyncQueryable<double> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double?> Average(this IAsyncQueryable<double?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float> Average(this IAsyncQueryable<float> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float?> Average(this IAsyncQueryable<float?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal> Average(this IAsyncQueryable<decimal> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Average(this IAsyncQueryable<decimal?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double> Average(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Average(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Average(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Average(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Average(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Average(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Average(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Average(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Average(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Average(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Average<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<IList<TSource>> Buffer<TSource>(this IAsyncQueryable<TSource> source, int count)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
+		}
+
+		public static IAsyncQueryable<IList<TSource>> Buffer<TSource>(this IAsyncQueryable<TSource> source, int count, int skip)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)), Expression.Constant(skip, typeof(int))));
+		}
+
+		public static IAsyncQueryable<TResult> Cast<TResult>(this IAsyncQueryable<object> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> Catch<TSource, TException>(this IAsyncQueryable<TSource> source, Expression<Func<TException, IAsyncEnumerable<TSource>>> handler)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (handler == null)
+				throw new ArgumentNullException("handler");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TException)), source.Expression, handler));
+		}
+
+		public static IAsyncQueryable<TSource> Catch<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
+		}
+
+		public static IAsyncQueryable<TSource> Concat<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
+		}
+
+		public static Task<bool> Contains<TSource>(this IAsyncQueryable<TSource> source, TSource value)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource))), CancellationToken.None);
+		}
+
+		public static Task<bool> Contains<TSource>(this IAsyncQueryable<TSource> source, TSource value, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<bool> Contains<TSource>(this IAsyncQueryable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
+		}
+
+		public static Task<bool> Contains<TSource>(this IAsyncQueryable<TSource> source, TSource value, IEqualityComparer<TSource> comparer, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int> Count<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<int> Count<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int> Count<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<int> Count<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<TSource> DefaultIfEmpty<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> DefaultIfEmpty<TSource>(this IAsyncQueryable<TSource> source, TSource defaultValue)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(defaultValue, typeof(TSource))));
+		}
+
+		public static IAsyncQueryable<TSource> Distinct<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
+		}
+
+		public static IAsyncQueryable<TSource> Distinct<TSource>(this IAsyncQueryable<TSource> source, IEqualityComparer<TSource> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
+		}
+
+		public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+		}
+
+		public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource>(this IAsyncQueryable<TSource> source, IEqualityComparer<TSource> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
+		}
+
+		public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
+		}
+
+		public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+		}
+
+		public static IAsyncQueryable<TSource> Do<TSource>(this IAsyncQueryable<TSource> source, Expression<Action<TSource>> onNext)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (onNext == null)
+				throw new ArgumentNullException("onNext");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext));
+		}
+
+		public static IAsyncQueryable<TSource> Do<TSource>(this IAsyncQueryable<TSource> source, IObserver<TSource> observer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (observer == null)
+				throw new ArgumentNullException("observer");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(observer, typeof(IObserver<TSource>))));
+		}
+
+		public static IAsyncQueryable<TSource> Do<TSource>(this IAsyncQueryable<TSource> source, Expression<Action<TSource>> onNext, Action onCompleted)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (onNext == null)
+				throw new ArgumentNullException("onNext");
+			if (onCompleted == null)
+				throw new ArgumentNullException("onCompleted");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext, Expression.Constant(onCompleted, typeof(Action))));
+		}
+
+		public static IAsyncQueryable<TSource> Do<TSource>(this IAsyncQueryable<TSource> source, Expression<Action<TSource>> onNext, Expression<Action<Exception>> onError)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (onNext == null)
+				throw new ArgumentNullException("onNext");
+			if (onError == null)
+				throw new ArgumentNullException("onError");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext, onError));
+		}
+
+		public static IAsyncQueryable<TSource> Do<TSource>(this IAsyncQueryable<TSource> source, Expression<Action<TSource>> onNext, Expression<Action<Exception>> 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");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, onNext, onError, Expression.Constant(onCompleted, typeof(Action))));
+		}
+
+		public static Task<TSource> ElementAt<TSource>(this IAsyncQueryable<TSource> source, int index)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None);
+		}
+
+		public static Task<TSource> ElementAt<TSource>(this IAsyncQueryable<TSource> source, int index, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> ElementAtOrDefault<TSource>(this IAsyncQueryable<TSource> source, int index)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None);
+		}
+
+		public static Task<TSource> ElementAtOrDefault<TSource>(this IAsyncQueryable<TSource> source, int index, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<TSource> Except<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
+		}
+
+		public static IAsyncQueryable<TSource> Except<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
+		}
+
+		public static IAsyncQueryable<TSource> Expand<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, IAsyncEnumerable<TSource>>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector));
+		}
+
+		public static IAsyncQueryable<TSource> Finally<TSource>(this IAsyncQueryable<TSource> source, Action finallyAction)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (finallyAction == null)
+				throw new ArgumentNullException("finallyAction");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(finallyAction, typeof(Action))));
+		}
+
+		public static Task<TSource> First<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> First<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> First<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<TSource> First<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> FirstOrDefault<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> FirstOrDefault<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> FirstOrDefault<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<TSource> FirstOrDefault<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
+		}
+
+		public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (elementSelector == null)
+				throw new ArgumentNullException("elementSelector");
+
+			return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector));
+		}
+
+		public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+		}
+
+		public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, TResult>> resultSelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (resultSelector == null)
+				throw new ArgumentNullException("resultSelector");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector));
+		}
+
+		public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> 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");
+
+			return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+		}
+
+		public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, 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");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector));
+		}
+
+		public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, TResult>> resultSelector, IEqualityComparer<TKey> 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");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+		}
+
+		public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, TResult>> resultSelector, IEqualityComparer<TKey> 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");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+		}
+
+		public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, 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");
+
+			return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
+		}
+
+		public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, TResult>> resultSelector, IEqualityComparer<TKey> 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");
+
+			return outer.Provider.CreateQuery<TResult>(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<TKey>))));
+		}
+
+		public static IAsyncQueryable<TSource> IgnoreElements<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> Intersect<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
+		}
+
+		public static IAsyncQueryable<TSource> Intersect<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
+		}
+
+		public static Task<bool> IsEmpty<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<bool> IsEmpty<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, 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");
+
+			return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
+		}
+
+		public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector, IEqualityComparer<TKey> 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");
+
+			return outer.Provider.CreateQuery<TResult>(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<TKey>))));
+		}
+
+		public static Task<TSource> Last<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> Last<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Last<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<TSource> Last<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> LastOrDefault<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> LastOrDefault<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> LastOrDefault<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<TSource> LastOrDefault<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> LongCount<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<long> LongCount<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> LongCount<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<long> LongCount<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int> Max(this IAsyncQueryable<int> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<long> Max(this IAsyncQueryable<long> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double> Max(this IAsyncQueryable<double> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float> Max(this IAsyncQueryable<float> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal> Max(this IAsyncQueryable<decimal> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<int?> Max(this IAsyncQueryable<int?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<long?> Max(this IAsyncQueryable<long?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double?> Max(this IAsyncQueryable<double?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float?> Max(this IAsyncQueryable<float?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Max(this IAsyncQueryable<decimal?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> Max<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<int> Max(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> Max(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Max(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Max(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Max(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int?> Max(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long?> Max(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Max(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Max(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Max(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Max<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Max<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer<TSource>))), CancellationToken.None);
+		}
+
+		public static Task<int> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<long> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<int?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<long?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<TResult> Max<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<TResult> Max<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Max<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource> comparer, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Max<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<IList<TSource>> MaxBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
+		}
+
+		public static Task<IList<TSource>> MaxBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<IList<TSource>> MaxBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))), CancellationToken.None);
+		}
+
+		public static Task<IList<TSource>> MaxBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int> Min(this IAsyncQueryable<int> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<long> Min(this IAsyncQueryable<long> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double> Min(this IAsyncQueryable<double> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float> Min(this IAsyncQueryable<float> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal> Min(this IAsyncQueryable<decimal> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<int?> Min(this IAsyncQueryable<int?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<long?> Min(this IAsyncQueryable<long?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double?> Min(this IAsyncQueryable<double?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float?> Min(this IAsyncQueryable<float?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Min(this IAsyncQueryable<decimal?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> Min<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<int> Min(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> Min(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Min(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Min(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Min(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int?> Min(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long?> Min(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Min(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Min(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Min(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Min<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<TSource> Min<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer<TSource>))), CancellationToken.None);
+		}
+
+		public static Task<int> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<long> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<int?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<long?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<TResult> Min<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<int> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Min<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TResult> Min<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Min<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource> comparer, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<IList<TSource>> MinBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
+		}
+
+		public static Task<IList<TSource>> MinBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<IList<TSource>> MinBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))), CancellationToken.None);
+		}
+
+		public static Task<IList<TSource>> MinBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<IList<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<TType> OfType<TType>(this IAsyncQueryable<object> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TType>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TType)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> OnErrorResumeNext<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> OrderBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> OrderBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
+		}
+
+		public static IAsyncQueryable<TSource> Repeat<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> Repeat<TSource>(this IAsyncQueryable<TSource> source, int count)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
+		}
+
+		public static IAsyncQueryable<TSource> Retry<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> Retry<TSource>(this IAsyncQueryable<TSource> source, int retryCount)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(retryCount, typeof(int))));
+		}
+
+		public static IAsyncQueryable<TSource> Reverse<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
+		}
+
+		public static IAsyncQueryable<TSource> Scan<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> accumulator)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator));
+		}
+
+		public static IAsyncQueryable<TAccumulate> Scan<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (accumulator == null)
+				throw new ArgumentNullException("accumulator");
+
+			return source.Provider.CreateQuery<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator));
+		}
+
+		public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
+		}
+
+		public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, TResult>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
+		}
+
+		public static IAsyncQueryable<TOther> SelectMany<TSource, TOther>(this IAsyncQueryable<TSource> source, IAsyncEnumerable<TOther> other)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (other == null)
+				throw new ArgumentNullException("other");
+
+			return source.Provider.CreateQuery<TOther>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TOther)), source.Expression, GetSourceExpression(other)));
+		}
+
+		public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, IAsyncEnumerable<TResult>>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
+		}
+
+		public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, IAsyncEnumerable<TResult>>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
+		}
+
+		public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, IAsyncEnumerable<TCollection>>> selector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+			if (resultSelector == null)
+				throw new ArgumentNullException("resultSelector");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
+		}
+
+		public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, IAsyncEnumerable<TCollection>>> selector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+			if (resultSelector == null)
+				throw new ArgumentNullException("resultSelector");
+
+			return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
+		}
+
+		public static Task<bool> SequenceEqual<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)), CancellationToken.None);
+		}
+
+		public static Task<bool> SequenceEqual<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, CancellationToken cancellationToken)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<bool> SequenceEqual<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
+		}
+
+		public static Task<bool> SequenceEqual<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer, CancellationToken cancellationToken)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Single<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> Single<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> Single<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<TSource> Single<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> SingleOrDefault<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource> SingleOrDefault<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<TSource> SingleOrDefault<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
+		}
+
+		public static Task<TSource> SingleOrDefault<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<TSource> Skip<TSource>(this IAsyncQueryable<TSource> source, int count)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
+		}
+
+		public static IAsyncQueryable<TSource> SkipLast<TSource>(this IAsyncQueryable<TSource> source, int count)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
+		}
+
+		public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
+		}
+
+		public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
+		}
+
+		public static IAsyncQueryable<TSource> StartWith<TSource>(this IAsyncQueryable<TSource> source, params TSource[] values)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (values == null)
+				throw new ArgumentNullException("values");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(values, typeof(TSource[]))));
+		}
+
+		public static Task<int> Sum(this IAsyncQueryable<int> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<long> Sum(this IAsyncQueryable<long> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double> Sum(this IAsyncQueryable<double> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float> Sum(this IAsyncQueryable<float> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal> Sum(this IAsyncQueryable<decimal> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<int?> Sum(this IAsyncQueryable<int?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<long?> Sum(this IAsyncQueryable<long?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<double?> Sum(this IAsyncQueryable<double?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<float?> Sum(this IAsyncQueryable<float?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Sum(this IAsyncQueryable<decimal?> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<int> Sum(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> Sum(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Sum(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Sum(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Sum(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int?> Sum(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long?> Sum(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Sum(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Sum(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Sum(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<long> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<int?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<long?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<double?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<float?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<decimal?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
+		}
+
+		public static Task<int> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<int?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<long?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<double?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<float?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<decimal?> Sum<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<TSource> Take<TSource>(this IAsyncQueryable<TSource> source, int count)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
+		}
+
+		public static IAsyncQueryable<TSource> TakeLast<TSource>(this IAsyncQueryable<TSource> source, int count)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
+		}
+
+		public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
+		}
+
+		public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
+		}
+
+		public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
+		}
+
+		public static Task<TSource[]> ToArray<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource[]>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<TSource[]> ToArray<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<TSource[]>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<Dictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
+		}
+
+		public static Task<Dictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<Dictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (elementSelector == null)
+				throw new ArgumentNullException("elementSelector");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None);
+		}
+
+		public static Task<Dictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
+		}
+
+		public static Task<Dictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (elementSelector == null)
+				throw new ArgumentNullException("elementSelector");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<Dictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<Dictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> 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");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
+		}
+
+		public static Task<Dictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> 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");
+
+			return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<List<TSource>> ToList<TSource>(this IAsyncQueryable<TSource> source)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<List<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
+		}
+
+		public static Task<List<TSource>> ToList<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+
+			return source.Provider.ExecuteAsync<List<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
+		}
+
+		public static Task<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (elementSelector == null)
+				throw new ArgumentNullException("elementSelector");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None);
+		}
+
+		public static Task<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
+		}
+
+		public static Task<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (elementSelector == null)
+				throw new ArgumentNullException("elementSelector");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<ILookup<TKey, TSource>> ToLookup<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (keySelector == null)
+				throw new ArgumentNullException("keySelector");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static Task<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> 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");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
+		}
+
+		public static Task<ILookup<TKey, TElement>> ToLookup<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> 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");
+
+			return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
+		}
+
+		public static IAsyncQueryable<TSource> Union<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
+		}
+
+		public static IAsyncQueryable<TSource> Union<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+			if (comparer == null)
+				throw new ArgumentNullException("comparer");
+
+			return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
+		}
+
+		public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
+		}
+
+		public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
+		{
+			if (source == null)
+				throw new ArgumentNullException("source");
+			if (predicate == null)
+				throw new ArgumentNullException("predicate");
+
+			return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
+		}
+
+		public static IAsyncQueryable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncQueryable<TFirst> first, IAsyncEnumerable<TSecond> second, Expression<Func<TFirst, TSecond, TResult>> selector)
+		{
+			if (first == null)
+				throw new ArgumentNullException("first");
+			if (second == null)
+				throw new ArgumentNullException("second");
+			if (selector == null)
+				throw new ArgumentNullException("selector");
+
+			return first.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond), typeof(TResult)), first.Expression, GetSourceExpression(second), selector));
+		}
+
+	}
+}

+ 269 - 0
Ix.NET/Source/System.Interactive.Async.Providers/AsyncQueryable.Generated.tt

@@ -0,0 +1,269 @@
+<#@ template debug="false" hostspecific="false" language="C#" #>
+<#@ assembly name="System.Core" #>
+<#@ assembly name="$(ProjectDir)\..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll" #>
+<#@ import namespace="System.Linq" #>
+<#@ import namespace="System.Text" #>
+<#@ import namespace="System.Threading" #>
+<#@ import namespace="System.Threading.Tasks" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ output extension=".cs" #>
+<#
+var exclude = new[] { "ForEach", "ForEachAsync", "ToEnumerable", "ToAsyncEnumerable", "ToObservable", "AsAsyncEnumerable" };
+
+var toQuotedImpl = default(Func<Type, int, bool, string>);
+toQuotedImpl = (t, i, b) =>
+{
+var name = t.Name;
+
+if (t.IsGenericType)
+{
+	var genDef = t.GetGenericTypeDefinition();
+	name = genDef.Name.Substring(0, genDef.Name.LastIndexOf('`'));
+
+	var genArgs = "<" + string.Join(", ", t.GetGenericArguments().Select(a => toQuotedImpl(a, i, false))) + ">";
+
+	if (b)
+	{
+		if (name == "Func" || name == "Action")
+		{
+			name = "Expression<" + name + genArgs + ">";
+		}
+		else if (name == "IAsyncEnumerable" && i == 0)
+		{
+			name = "IAsyncQueryable" + genArgs;
+		}
+		else if (name == "IOrderedAsyncEnumerable" && i == 0)
+		{
+			name = "IOrderedAsyncQueryable" + genArgs;
+		}
+		else
+		{
+			name += genArgs;
+		}
+	}
+	else
+	{
+		if (name == "Nullable")
+		{
+			name = genArgs.Substring(1, genArgs.Length - 2) + "?";
+		}
+		else
+		{
+			name += genArgs;
+		}
+	}
+}
+else if (t.IsArray)
+{
+	var elem = toQuotedImpl(t.GetElementType(), i, b);
+	name = elem + "[]";
+}
+else
+{
+	if (t == typeof(int))
+	{
+		name = "int";
+	}
+	else if (t == typeof(long))
+	{
+		name = "long";
+	}
+	else if (t == typeof(float))
+	{
+		name = "float";
+	}
+	else if (t == typeof(double))
+	{
+		name = "double";
+	}
+	else if (t == typeof(decimal))
+	{
+		name = "decimal";
+	}
+	else if (t == typeof(bool))
+	{
+		name = "bool";
+	}
+	else if (t == typeof(object))
+	{
+		name = "object";
+	}
+}
+
+return name;
+};
+
+var toQuoted = new Func<Type, int, string>((t, i) => toQuotedImpl(t, i, true));
+#>
+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
+	{
+<#
+// NOTE: Just including extension methods
+foreach (var m in typeof(AsyncEnumerable).GetMethods()
+						.Where(m => m.IsStatic)
+						.Where(m => !exclude.Contains(m.Name))
+						.Where(m => m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true))
+						.Where(m =>
+						{
+							var p0 = m.GetParameters()[0].ParameterType;
+							if (p0.IsGenericType)
+							{
+								var p0d = p0.GetGenericTypeDefinition();
+								return p0d == typeof(IAsyncEnumerable<>) || p0d == typeof(IOrderedAsyncEnumerable<>);
+							}
+
+							return false;
+						})
+						.OrderBy(m => m.Name)
+						.ThenBy(m => m.GetParameters().Length))
+{
+	var genArgs = m.GetGenericArguments();
+
+	var ret = toQuoted(m.ReturnType, 0);
+	var name = m.Name;
+
+	if (genArgs.Length > 0)
+	{
+		name += "<" + string.Join(", ", genArgs.Select(a => a.Name)) + ">";
+	}
+
+	var isParams = false;
+	var parCount = m.GetParameters().Length;
+
+	if (parCount != 0)
+	{
+		if (m.GetParameters().Last().IsDefined(typeof(ParamArrayAttribute), true))
+		{
+			isParams = true;
+		}
+	}
+
+	var pars = string.Join(", ", m.GetParameters().Select((p, i) => (i == parCount - 1 && isParams ? "params " : "") + toQuoted(p.ParameterType, i) + " " + p.Name));
+
+	if (m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true))
+	{
+		pars = "this " + pars;
+	}
+
+	var mtd = "(MethodInfo)MethodBase.GetCurrentMethod()";
+
+	if (m.IsGenericMethod)
+	{
+		mtd = "(" + mtd + ").MakeGenericMethod(" + string.Join(", ", genArgs.Select(a => "typeof(" + a.Name + ")")) + ")";
+	}
+
+	var provider = m.GetParameters()[0].Name + ".Provider";
+	var factory = "";
+	var rem = "";
+	var cast = "";
+	var quotedArgs = new List<string>();
+
+	if (m.ReturnType.IsGenericType)
+	{
+		var td = m.ReturnType.GetGenericTypeDefinition();
+
+		if (td == typeof(Task<>))
+		{
+			factory = "ExecuteAsync<" + toQuotedImpl(m.ReturnType.GetGenericArguments()[0], -1, false) + ">";
+
+			var last = m.GetParameters().Last();
+			if (last.ParameterType == typeof(CancellationToken))
+			{
+				rem = ", " + last.Name;
+			}
+			else
+			{
+				rem = ", CancellationToken.None";
+			}
+		}
+		else if (td == typeof(IAsyncEnumerable<>) || td == typeof(IOrderedAsyncEnumerable<>))
+		{
+			factory = "CreateQuery<" + toQuotedImpl(m.ReturnType.GetGenericArguments()[0], -1, false) + ">";
+
+			if (td == typeof(IOrderedAsyncEnumerable<>))
+			{
+				cast = "(" + toQuoted(m.ReturnType, 0) + ")";
+			}
+		}
+	}
+
+	var n = 0;
+	foreach (var p in m.GetParameters())
+	{
+		var pt = p.ParameterType;
+
+		var add = false;
+
+		if (pt.IsGenericType)
+		{
+			var ptd = pt.GetGenericTypeDefinition();
+
+			if (ptd == typeof(IAsyncEnumerable<>) || ptd == typeof(IOrderedAsyncEnumerable<>))
+			{
+				if (n == 0)
+				{
+					quotedArgs.Add(p.Name + ".Expression");
+				}
+				else
+				{
+					quotedArgs.Add("GetSourceExpression(" + p.Name + ")");
+				}
+				add = true;
+			}
+			else if (ptd.Name.StartsWith("Func") || ptd.Name.StartsWith("Action"))
+			{
+				quotedArgs.Add(p.Name);
+				add = true;
+			}
+		}
+		
+		if (!add)
+		{
+			quotedArgs.Add("Expression.Constant(" + p.Name + ", typeof(" + toQuoted(pt, -1) + "))");
+		}
+
+		n++;
+	}
+
+	var expr = "Expression.Call(" + mtd + ", " + string.Join(", ", quotedArgs) + ")";
+#>
+		public static <#=ret#> <#=name#>(<#=pars#>)
+		{
+<#
+var any = false;
+foreach (var p in m.GetParameters())
+{
+	if (!p.ParameterType.IsValueType && !p.ParameterType.IsGenericParameter)
+	{
+		any = true;
+#>
+			if (<#=p.Name#> == null)
+				throw new ArgumentNullException("<#=p.Name#>");
+<#
+	}
+}
+#>
+<#
+if (any)
+{
+#>
+
+<#
+}
+#>
+			return <#=cast#><#=provider#>.<#=factory#>(<#=expr#><#=rem#>);
+		}
+
+<#
+}
+#>
+	}
+}

+ 43 - 0
Ix.NET/Source/System.Interactive.Async.Providers/AsyncQueryable.cs

@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+using System.Collections.Generic;
+using System.Linq.Expressions;
+
+namespace System.Linq
+{
+    /// <summary>
+    /// Provides a set of extension methods for asynchronous enumerable sequences represented using expression trees.
+    /// </summary>
+    public static partial class AsyncQueryable
+    {
+        /// <summary>
+        /// Converts the specified asynchronous enumerable sequence to an expression representation.
+        /// </summary>
+        /// <typeparam name="TElement">The type of the elements in the sequence.</typeparam>
+        /// <param name="source">The asynchronous enumerable sequence to represent using an expression tree.</param>
+        /// <returns>An asynchronous enumerable sequence using an expression tree to represent the specified asynchronous enumerable sequence.</returns>
+        public static IAsyncQueryable<TElement> AsAsyncQueryable<TElement>(this IAsyncEnumerable<TElement> source)
+        {
+            if (source == null)
+                throw new ArgumentNullException("source");
+
+            var queryable = source as IAsyncQueryable<TElement>;
+            if (queryable != null)
+            {
+                return queryable;
+            }
+
+            return new AsyncEnumerableQuery<TElement>(source);
+        }
+
+        private static Expression GetSourceExpression<TSource>(IAsyncEnumerable<TSource> source)
+        {
+            var queryable = source as IAsyncQueryable<TSource>;
+            if (queryable != null)
+            {
+                return queryable.Expression;
+            }
+
+            return Expression.Constant(source, typeof(IAsyncEnumerable<TSource>));
+        }
+    }
+}

+ 30 - 0
Ix.NET/Source/System.Interactive.Async.Providers/IAsyncQueryProvider.cs

@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+using System.Linq.Expressions;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Linq
+{
+    /// <summary>
+    /// Represents a query provider for asynchronous enumerable sequences.
+    /// </summary>
+    public interface IAsyncQueryProvider
+    {
+        /// <summary>
+        /// Creates a new asynchronous enumerable sequence represented by an expression tree.
+        /// </summary>
+        /// <typeparam name="TElement">The type of the elements in the sequence.</typeparam>
+        /// <param name="expression">The expression tree representing the asynchronous enumerable sequence.</param>
+        /// <returns>Asynchronous enumerable sequence represented by the specified expression tree.</returns>
+        IAsyncQueryable<TElement> CreateQuery<TElement>(Expression expression);
+
+        /// <summary>
+        /// Executes an expression tree representing a computation over asynchronous enumerable sequences.
+        /// </summary>
+        /// <typeparam name="TResult">The type of the result of evaluating the expression tree.</typeparam>
+        /// <param name="expression">The expression tree to evaluate.</param>
+        /// <param name="token">Cancellation token used to cancel the evaluation.</param>
+        /// <returns>Task representing the result of evaluating the specified expression tree.</returns>
+        Task<TResult> ExecuteAsync<TResult>(Expression expression, CancellationToken token);
+    }
+}

+ 35 - 0
Ix.NET/Source/System.Interactive.Async.Providers/IAsyncQueryable.cs

@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+using System.Collections.Generic;
+using System.Linq.Expressions;
+
+namespace System.Linq
+{
+    /// <summary>
+    /// Asynchronous enumerable sequence represented by an expression tree.
+    /// </summary>
+    public interface IAsyncQueryable
+    {
+        /// <summary>
+        /// Gets the type of the elements in the sequence.
+        /// </summary>
+        Type ElementType { get; }
+
+        /// <summary>
+        /// Gets the expression representing the sequence.
+        /// </summary>
+        Expression Expression { get; }
+
+        /// <summary>
+        /// Gets the query provider used to execute the sequence.
+        /// </summary>
+        IAsyncQueryProvider Provider { get; }
+    }
+
+    /// <summary>
+    /// Asynchronous enumerable sequence represented by an expression tree.
+    /// </summary>
+    /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+    public interface IAsyncQueryable<out T> : IAsyncEnumerable<T>, IAsyncQueryable
+    {
+    }
+}

+ 18 - 0
Ix.NET/Source/System.Interactive.Async.Providers/IOrderedAsyncQueryable.cs

@@ -0,0 +1,18 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+namespace System.Linq
+{
+    /// <summary>
+    /// Ordered asynchronous enumerable sequence represented by an expression tree.
+    /// </summary>
+    public interface IOrderedAsyncQueryable : IAsyncQueryable
+    {
+    }
+
+    /// <summary>
+    /// Ordered asynchronous enumerable sequence represented by an expression tree.
+    /// </summary>
+    /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
+    public interface IOrderedAsyncQueryable<T> : IAsyncQueryable<T>
+    {
+    }
+}

+ 37 - 0
Ix.NET/Source/System.Interactive.Async.Providers/Properties/AssemblyInfo.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Runtime.InteropServices;
+using System.Security;
+
+[assembly: AssemblyTitle("System.Interactive.Async.Providers")]
+// Notice: same description as in the .nuspec files; see Source/Interactive Extensions/Setup/NuGet
+[assembly: AssemblyDescription("Interactive Extensions Async Library used to build query providers and express queries over asynchronous enumerable sequences.")]
+#if DEBUG
+[assembly: AssemblyConfiguration("Debug")]
+#else
+[assembly: AssemblyConfiguration("Retail")]
+#endif
+[assembly: AssemblyCompany("Microsoft Open Technologies, Inc.")]
+[assembly: AssemblyProduct("Interactive Extensions")]
+[assembly: AssemblyCopyright("\x00a9 Microsoft Open Technologies, Inc.  All rights reserved.")]
+[assembly: NeutralResourcesLanguage("en-US")]
+
+#if !PLIB
+[assembly: ComVisible(false)]
+#endif
+
+[assembly: CLSCompliant(true)]
+
+#if HAS_APTCA && NO_CODECOVERAGE
+[assembly: AllowPartiallyTrustedCallers]
+#endif
+
+// ===========================================================================
+//  DO NOT EDIT OR REMOVE ANYTHING BELOW THIS COMMENT.
+//  Version numbers are automatically generated in the msbuild files based on regular expressions 
+// ===========================================================================
+
+[assembly: AssemblyVersion("1.2.0.0")]
+[assembly: AssemblyFileVersion("1.2.0.0")]
+[assembly: AssemblyInformationalVersion("1.2.0.0")]

+ 60 - 0
Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{B0350CD4-37F7-4508-B67F-D4BB3B9092AA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>System.Interactive.Async.Providers</RootNamespace>
+    <AssemblyName>System.Interactive.Async.Providers</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProductSignAssembly>true</ProductSignAssembly>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWP8|AnyCPU'">
+    <OutputPath>bin\ReleaseWP8\</OutputPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugWP8|AnyCPU'">
+    <OutputPath>bin\DebugWP8\</OutputPath>
+    <DefineConstants>;WINDOWSPHONE7;NO_TLS;NO_VARIANCE;NO_SERIALIZABLE;NO_TPL;NO_HASHSET;NO_REMOTING;NO_SEMAPHORE;NO_LARGEARITY;NO_ZIP;SILVERLIGHT;SILVERLIGHTM7;TRACE</DefineConstants>
+    <DocumentationFile>..\bin\ReleaseWP7\System.Interactive.Async.XML</DocumentationFile>
+    <Optimize>true</Optimize>
+    <NoWarn>1591</NoWarn>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <Import Project="..\Common.targets" />
+  <PropertyGroup>
+    <DocumentationFile>$(OutputPath)\$(AssemblyName).XML</DocumentationFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="mscorlib" Condition=" '$(BuildPlatform)' == 'SILVERLIGHT' or '$(TargetFrameworkIdentifier)' == '.NETPortable' " />
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AsyncEnumerableExecutor.cs" />
+    <Compile Include="AsyncEnumerableQuery.cs" />
+    <Compile Include="AsyncEnumerableRewriter.cs" />
+    <Compile Include="AsyncQueryable.cs" />
+    <Compile Include="AsyncQueryable.Generated.cs" />
+    <Compile Include="IAsyncQueryable.cs" />
+    <Compile Include="IAsyncQueryProvider.cs" />
+    <Compile Include="IOrderedAsyncQueryable.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\System.Interactive.Async\System.Interactive.Async.csproj">
+      <Project>{7269a578-326a-4c3e-9874-a2d2600095bc}</Project>
+      <Name>System.Interactive.Async</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
+  <Import Project="..\Import.targets" />
+</Project>

+ 47 - 0
Ix.NET/Source/Tests/AssertEx.cs

@@ -0,0 +1,47 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+
+namespace Tests
+{
+    internal class AssertEx
+    {
+        internal static void Throws<T>(Action action)
+            where T : Exception
+        {
+            Throws<T>(action, _ => true);
+        }
+
+        internal static void Throws<T>(Action action, Func<T, bool> assert)
+            where T : Exception
+        {
+            var failed = false;
+
+            try
+            {
+                action();
+            }
+            catch (T ex)
+            {
+                Assert.IsTrue(assert(ex));
+
+                failed = true;
+            }
+
+            Assert.IsTrue(failed);
+        }
+
+        internal static void SucceedOrFailProper(Action action)
+        {
+            try
+            {
+                action();   
+            }
+            catch (AggregateException ex)
+            {
+                var inner = ex.Flatten().InnerException;
+
+                // TODO: proper assert; unfortunately there's not always a good call stack
+            }
+        }
+    }
+}

+ 3374 - 0
Ix.NET/Source/Tests/AsyncQueryableTests.Generated.cs

@@ -0,0 +1,3374 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace Tests
+{
+	[TestClass]
+	public class AsyncQueryableTests
+	{
+		[TestMethod]
+		public void Aggregate1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "accumulator");
+
+			var res = AsyncQueryable.Aggregate<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Aggregate2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, int>>), CancellationToken.None), ane => ane.ParamName == "accumulator");
+
+			var res = AsyncQueryable.Aggregate<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Aggregate3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int>(default(IAsyncQueryable<int>), 1, (int arg0, int arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "accumulator");
+
+			var res = AsyncQueryable.Aggregate<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, (int arg0, int arg1) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Aggregate4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int>(default(IAsyncQueryable<int>), 1, (int arg0, int arg1) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, default(Expression<Func<int, int, int>>), CancellationToken.None), ane => ane.ParamName == "accumulator");
+
+			var res = AsyncQueryable.Aggregate<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, (int arg0, int arg1) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Aggregate5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int, int>(default(IAsyncQueryable<int>), 1, (int arg0, int arg1) => default(int), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, default(Expression<Func<int, int, int>>), (int arg0) => default(int)), ane => ane.ParamName == "accumulator");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, (int arg0, int arg1) => default(int), default(Expression<Func<int, int>>)), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.Aggregate<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, (int arg0, int arg1) => default(int), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Aggregate6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int, int>(default(IAsyncQueryable<int>), 1, (int arg0, int arg1) => default(int), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, default(Expression<Func<int, int, int>>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "accumulator");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Aggregate<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, (int arg0, int arg1) => default(int), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.Aggregate<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, (int arg0, int arg1) => default(int), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void All1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.All<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.All<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.All<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void All2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.All<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.All<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.All<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Any1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Any<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Any<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Any2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Any<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Any<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Any3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Any<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Any<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Any<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Any4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Any<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Any<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Any<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<int?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<long>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<long?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<double>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<double?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average7()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<float>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average8()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<float?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average9()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<decimal>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average10()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<decimal?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average11()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average12()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<int?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average13()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average14()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<long?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average15()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average16()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<double?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average17()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average18()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<float?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average19()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average20()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average(default(IAsyncQueryable<decimal?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Average(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average21()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average22()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average23()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(long)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average24()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average25()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(double)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average26()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average27()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(float)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average28()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average29()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average30()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average31()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average32()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average33()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(long), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average34()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average35()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(double), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average36()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average37()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(float), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average38()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average39()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Average40()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Average<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Buffer1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Buffer<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Buffer<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Buffer2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Buffer<int>(default(IAsyncQueryable<int>), 1, 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Buffer<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, 1);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Cast1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Cast<int>(default(IAsyncQueryable<object>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Cast<int>(new object[] { default(object) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Catch1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Catch<int, Exception>(default(IAsyncQueryable<int>), (Exception arg0) => new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Catch<int, Exception>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<Exception, IAsyncEnumerable<int>>>)), ane => ane.ParamName == "handler");
+
+			var res = AsyncQueryable.Catch<int, Exception>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (Exception arg0) => new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Catch2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Catch<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Catch<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.Catch<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Concat1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Concat<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Concat<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.Concat<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Contains1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Contains<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Contains<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Contains2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Contains<int>(default(IAsyncQueryable<int>), 1, CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Contains<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Contains3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Contains<int>(default(IAsyncQueryable<int>), 1, EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Contains<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Contains<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, EqualityComparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Contains4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Contains<int>(default(IAsyncQueryable<int>), 1, EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Contains<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, default(IEqualityComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Contains<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, EqualityComparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Count1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Count<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Count<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Count2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Count<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Count<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Count3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Count<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Count<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Count<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Count4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Count<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Count<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Count<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void DefaultIfEmpty1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DefaultIfEmpty<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.DefaultIfEmpty<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void DefaultIfEmpty2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DefaultIfEmpty<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.DefaultIfEmpty<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Distinct1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Distinct<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Distinct2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.Distinct<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Distinct3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int>(default(IAsyncQueryable<int>), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Distinct<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Distinct4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Distinct<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Distinct<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void DistinctUntilChanged1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.DistinctUntilChanged<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void DistinctUntilChanged2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int>(default(IAsyncQueryable<int>), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.DistinctUntilChanged<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void DistinctUntilChanged3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.DistinctUntilChanged<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void DistinctUntilChanged4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.DistinctUntilChanged<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.DistinctUntilChanged<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Do1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(default(IAsyncQueryable<int>), (int arg0) => Console.WriteLine()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Action<int>>)), ane => ane.ParamName == "onNext");
+
+			var res = AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Do2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(default(IAsyncQueryable<int>), new NopObserver<int>()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IObserver<int>)), ane => ane.ParamName == "observer");
+
+			var res = AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new NopObserver<int>());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Do3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(default(IAsyncQueryable<int>), (int arg0) => Console.WriteLine(), () => { }), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Action<int>>), () => { }), ane => ane.ParamName == "onNext");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine(), default(Action)), ane => ane.ParamName == "onCompleted");
+
+			var res = AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine(), () => { });
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Do4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(default(IAsyncQueryable<int>), (int arg0) => Console.WriteLine(), (Exception arg0) => Console.WriteLine()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Action<int>>), (Exception arg0) => Console.WriteLine()), ane => ane.ParamName == "onNext");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine(), default(Expression<Action<Exception>>)), ane => ane.ParamName == "onError");
+
+			var res = AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine(), (Exception arg0) => Console.WriteLine());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Do5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(default(IAsyncQueryable<int>), (int arg0) => Console.WriteLine(), (Exception arg0) => Console.WriteLine(), () => { }), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Action<int>>), (Exception arg0) => Console.WriteLine(), () => { }), ane => ane.ParamName == "onNext");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine(), default(Expression<Action<Exception>>), () => { }), ane => ane.ParamName == "onError");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine(), (Exception arg0) => Console.WriteLine(), default(Action)), ane => ane.ParamName == "onCompleted");
+
+			var res = AsyncQueryable.Do<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => Console.WriteLine(), (Exception arg0) => Console.WriteLine(), () => { });
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void ElementAt1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ElementAt<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ElementAt<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ElementAt2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ElementAt<int>(default(IAsyncQueryable<int>), 1, CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ElementAt<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ElementAtOrDefault1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ElementAtOrDefault<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ElementAtOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ElementAtOrDefault2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ElementAtOrDefault<int>(default(IAsyncQueryable<int>), 1, CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ElementAtOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Except1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Except<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Except<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.Except<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Except2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Except<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Except<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), EqualityComparer<int>.Default), ane => ane.ParamName == "second");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Except<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Except<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Expand1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Expand<int>(default(IAsyncQueryable<int>), (int arg0) => new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Expand<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, IAsyncEnumerable<int>>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Expand<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => new int[] { default(int) }.ToAsyncEnumerable());
+			res = res.Take(5);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Finally1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Finally<int>(default(IAsyncQueryable<int>), () => { }), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Finally<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Action)), ane => ane.ParamName == "finallyAction");
+
+			var res = AsyncQueryable.Finally<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), () => { });
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void First1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.First<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.First<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void First2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.First<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.First<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void First3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.First<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.First<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.First<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void First4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.First<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.First<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.First<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void FirstOrDefault1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.FirstOrDefault<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.FirstOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void FirstOrDefault2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.FirstOrDefault<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.FirstOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void FirstOrDefault3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.FirstOrDefault<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.FirstOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.FirstOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void FirstOrDefault4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.FirstOrDefault<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.FirstOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.FirstOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.GroupBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int)), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>)), ane => ane.ParamName == "elementSelector");
+
+			var res = AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.GroupBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, IAsyncEnumerable<int>, int>>)), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "elementSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "elementSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), default(Expression<Func<int, IAsyncEnumerable<int>, int>>)), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy7()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, IAsyncEnumerable<int>, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "resultSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.GroupBy<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupBy8()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "elementSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), default(Expression<Func<int, IAsyncEnumerable<int>, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "resultSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.GroupBy<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupJoin1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "outer");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "inner");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(Expression<Func<int, int>>), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "outerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), default(Expression<Func<int, int>>), (int arg0, IAsyncEnumerable<int> arg1) => default(int)), ane => ane.ParamName == "innerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), default(Expression<Func<int, IAsyncEnumerable<int>, int>>)), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void GroupJoin2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "outer");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "inner");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(Expression<Func<int, int>>), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "outerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), default(Expression<Func<int, int>>), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "innerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), default(Expression<Func<int, IAsyncEnumerable<int>, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "resultSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.GroupJoin<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, IAsyncEnumerable<int> arg1) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void IgnoreElements1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.IgnoreElements<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.IgnoreElements<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Intersect1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Intersect<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Intersect<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.Intersect<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Intersect2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Intersect<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Intersect<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), EqualityComparer<int>.Default), ane => ane.ParamName == "second");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Intersect<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Intersect<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void IsEmpty1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.IsEmpty<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.IsEmpty<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void IsEmpty2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.IsEmpty<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.IsEmpty<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Join1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "outer");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), (int arg0) => default(int), (int arg0) => default(int), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "inner");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(Expression<Func<int, int>>), (int arg0) => default(int), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "outerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), default(Expression<Func<int, int>>), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "innerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, int arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Join2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, int arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "outer");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), (int arg0) => default(int), (int arg0) => default(int), (int arg0, int arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "inner");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(Expression<Func<int, int>>), (int arg0) => default(int), (int arg0, int arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "outerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), default(Expression<Func<int, int>>), (int arg0, int arg1) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "innerKeySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), default(Expression<Func<int, int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "resultSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, int arg1) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Join<int, int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0) => default(int), (int arg0) => default(int), (int arg0, int arg1) => default(int), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Last1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Last<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Last<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Last2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Last<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Last<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Last3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Last<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Last<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Last<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Last4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Last<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Last<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Last<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LastOrDefault1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LastOrDefault<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.LastOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LastOrDefault2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LastOrDefault<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.LastOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LastOrDefault3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LastOrDefault<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LastOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.LastOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LastOrDefault4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LastOrDefault<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LastOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.LastOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LongCount1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LongCount<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.LongCount<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LongCount2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LongCount<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.LongCount<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LongCount3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LongCount<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LongCount<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.LongCount<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void LongCount4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LongCount<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.LongCount<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.LongCount<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<long>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<double>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<float>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<decimal>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<int?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max7()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<long?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max8()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<double?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max9()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<float?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max10()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<decimal?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max11()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max12()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max13()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max14()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max15()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max16()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max17()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<int?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max18()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<long?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max19()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<double?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max20()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<float?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max21()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max(default(IAsyncQueryable<decimal?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max22()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max23()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), Comparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max24()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max25()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(long)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max26()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(double)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max27()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(float)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max28()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max29()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max30()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max31()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max32()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max33()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max34()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max35()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max36()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), Comparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), Comparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max37()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max38()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(long), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max39()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(double), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max40()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(float), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max41()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max42()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max43()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max44()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max45()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Max46()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Max<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MaxBy1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MaxBy2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MaxBy3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), Comparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), Comparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MaxBy4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), Comparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.MaxBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), Comparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<long>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<double>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<float>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<decimal>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<int?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min7()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<long?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min8()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<double?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min9()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<float?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min10()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<decimal?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min11()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min12()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min13()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min14()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min15()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min16()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min17()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<int?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min18()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<long?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min19()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<double?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min20()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<float?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min21()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min(default(IAsyncQueryable<decimal?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min22()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min23()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min24()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min25()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), Comparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min26()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min27()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(long)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min28()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(double)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min29()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(float)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min30()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min31()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min32()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min33()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min34()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min35()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min36()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(long), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min37()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(double), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min38()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(float), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min39()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min40()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min41()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min42()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min43()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min44()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min45()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Min<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Min46()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(default(IAsyncQueryable<int>), Comparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Min<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), Comparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MinBy1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MinBy2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MinBy3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), Comparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), Comparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void MinBy4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), Comparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.MinBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), Comparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void OfType1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OfType<int>(default(IAsyncQueryable<object>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.OfType<int>(new object[] { default(object) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void OnErrorResumeNext1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OnErrorResumeNext<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OnErrorResumeNext<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.OnErrorResumeNext<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void OrderBy1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.OrderBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+		}
+
+		[TestMethod]
+		public void OrderBy2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderBy<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), Comparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.OrderBy<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), Comparer<int>.Default);
+		}
+
+		[TestMethod]
+		public void OrderByDescending1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderByDescending<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderByDescending<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.OrderByDescending<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+		}
+
+		[TestMethod]
+		public void OrderByDescending2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderByDescending<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderByDescending<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), Comparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.OrderByDescending<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.OrderByDescending<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), Comparer<int>.Default);
+		}
+
+		[TestMethod]
+		public void Repeat1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Repeat<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Repeat<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			res = res.Take(5);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Repeat2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Repeat<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Repeat<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			res = res.Take(5);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Retry1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Retry<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Retry<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Retry2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Retry<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Retry<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Reverse1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Reverse<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Reverse<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Scan1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Scan<int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Scan<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "accumulator");
+
+			var res = AsyncQueryable.Scan<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Scan2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Scan<int, int>(default(IAsyncQueryable<int>), 1, (int arg0, int arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Scan<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "accumulator");
+
+			var res = AsyncQueryable.Scan<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1, (int arg0, int arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Select1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Select<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Select<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Select<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Select2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Select<int, int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Select<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Select<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SelectMany1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "other");
+
+			var res = AsyncQueryable.SelectMany<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SelectMany2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int>(default(IAsyncQueryable<int>), (int arg0) => new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, IAsyncEnumerable<int>>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.SelectMany<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SelectMany3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, IAsyncEnumerable<int>>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.SelectMany<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SelectMany4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => new int[] { default(int) }.ToAsyncEnumerable(), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, IAsyncEnumerable<int>>>), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "selector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => new int[] { default(int) }.ToAsyncEnumerable(), default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.SelectMany<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => new int[] { default(int) }.ToAsyncEnumerable(), (int arg0, int arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SelectMany5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int, int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => new int[] { default(int) }.ToAsyncEnumerable(), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, IAsyncEnumerable<int>>>), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "selector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SelectMany<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => new int[] { default(int) }.ToAsyncEnumerable(), default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "resultSelector");
+
+			var res = AsyncQueryable.SelectMany<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => new int[] { default(int) }.ToAsyncEnumerable(), (int arg0, int arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SequenceEqual1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void SequenceEqual2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), CancellationToken.None), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), CancellationToken.None), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void SequenceEqual3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), EqualityComparer<int>.Default), ane => ane.ParamName == "second");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void SequenceEqual4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "second");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(IEqualityComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.SequenceEqual<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Single1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Single<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Single<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Single2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Single<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Single<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Single3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Single<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Single<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Single<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Single4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Single<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Single<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Single<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void SingleOrDefault1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SingleOrDefault<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.SingleOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void SingleOrDefault2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SingleOrDefault<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.SingleOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void SingleOrDefault3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SingleOrDefault<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SingleOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.SingleOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void SingleOrDefault4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SingleOrDefault<int>(default(IAsyncQueryable<int>), (int arg0) => true, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SingleOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>), CancellationToken.None), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.SingleOrDefault<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Skip1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Skip<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Skip<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SkipLast1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SkipLast<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.SkipLast<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SkipWhile1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SkipWhile<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SkipWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.SkipWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void SkipWhile2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SkipWhile<int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.SkipWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.SkipWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => true);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void StartWith1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.StartWith<int>(default(IAsyncQueryable<int>), new int[] { default(int) }), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.StartWith<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(int[])), ane => ane.ParamName == "values");
+
+			var res = AsyncQueryable.StartWith<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) });
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Sum1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<long>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<double>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<float>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<decimal>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<int?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum7()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<long?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum8()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<double?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum9()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<float?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum10()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<decimal?>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum11()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum12()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new long[] { default(long) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum13()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new double[] { default(double) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum14()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new float[] { default(float) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum15()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new decimal[] { default(decimal) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum16()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<int?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new int?[] { default(int?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum17()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<long?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new long?[] { default(long?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum18()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<double?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new double?[] { default(double?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum19()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<float?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new float?[] { default(float?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum20()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum(default(IAsyncQueryable<decimal?>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Sum(new decimal?[] { default(decimal?) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum21()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum22()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(long)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum23()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(double)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum24()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(float)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum25()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum26()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum27()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum28()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum29()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum30()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum31()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum32()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(long), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(long), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum33()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(double), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(double), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum34()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(float), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(float), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum35()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(decimal), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(decimal), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum36()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<int>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum37()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<long>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, long?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<long>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum38()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<double>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, double?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<double>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum39()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<float>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, float?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<float>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Sum40()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(default(IAsyncQueryable<int>), (int arg0) => default(Nullable<decimal>), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, decimal?>>), CancellationToken.None), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Sum<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(Nullable<decimal>), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Take1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Take<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.Take<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void TakeLast1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.TakeLast<int>(default(IAsyncQueryable<int>), 1), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.TakeLast<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), 1);
+            var task = res.ForEachAsync(_ => { });
+            AssertEx.SucceedOrFailProper(() => task.Wait());
+        }
+
+		[TestMethod]
+		public void TakeWhile1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.TakeWhile<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.TakeWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.TakeWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void TakeWhile2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.TakeWhile<int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.TakeWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.TakeWhile<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => true);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void ThenBy1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenBy<int, int>(default(IOrderedAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenBy<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.ThenBy<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), (int arg0) => default(int));
+		}
+
+		[TestMethod]
+		public void ThenBy2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenBy<int, int>(default(IOrderedAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenBy<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), default(Expression<Func<int, int>>), Comparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenBy<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), (int arg0) => default(int), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ThenBy<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), (int arg0) => default(int), Comparer<int>.Default);
+		}
+
+		[TestMethod]
+		public void ThenByDescending1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenByDescending<int, int>(default(IOrderedAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenByDescending<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.ThenByDescending<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), (int arg0) => default(int));
+		}
+
+		[TestMethod]
+		public void ThenByDescending2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenByDescending<int, int>(default(IOrderedAsyncQueryable<int>), (int arg0) => default(int), Comparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenByDescending<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), default(Expression<Func<int, int>>), Comparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ThenByDescending<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), (int arg0) => default(int), default(IComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ThenByDescending<int, int>(new int[0].ToAsyncEnumerable().AsAsyncQueryable().OrderBy(x => x), (int arg0) => default(int), Comparer<int>.Default);
+		}
+
+		[TestMethod]
+		public void ToArray1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToArray<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ToArray<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToArray2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToArray<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ToArray<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int)), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>)), ane => ane.ParamName == "elementSelector");
+
+			var res = AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), EqualityComparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "elementSelector");
+
+			var res = AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IEqualityComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToDictionary<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary7()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "elementSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToDictionary8()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "elementSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), default(IEqualityComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToDictionary<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToList1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToList<int>(default(IAsyncQueryable<int>)), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ToList<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable());
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToList2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToList<int>(default(IAsyncQueryable<int>), CancellationToken.None), ane => ane.ParamName == "source");
+
+			var res = AsyncQueryable.ToList<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>)), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "keySelector");
+
+			var res = AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup3()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int)), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int)), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>)), ane => ane.ParamName == "elementSelector");
+
+			var res = AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int));
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup4()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), EqualityComparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup5()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), CancellationToken.None), ane => ane.ParamName == "elementSelector");
+
+			var res = AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup6()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(IEqualityComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToLookup<int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup7()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), EqualityComparer<int>.Default), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), EqualityComparer<int>.Default), ane => ane.ParamName == "elementSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void ToLookup8()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(default(IAsyncQueryable<int>), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int>>), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "keySelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), default(Expression<Func<int, int>>), EqualityComparer<int>.Default, CancellationToken.None), ane => ane.ParamName == "elementSelector");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), default(IEqualityComparer<int>), CancellationToken.None), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.ToLookup<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => default(int), (int arg0) => default(int), EqualityComparer<int>.Default, CancellationToken.None);
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+		}
+
+		[TestMethod]
+		public void Union1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Union<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable()), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Union<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>)), ane => ane.ParamName == "second");
+
+			var res = AsyncQueryable.Union<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable());
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Union2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Union<int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Union<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), EqualityComparer<int>.Default), ane => ane.ParamName == "second");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Union<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(IEqualityComparer<int>)), ane => ane.ParamName == "comparer");
+
+			var res = AsyncQueryable.Union<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), EqualityComparer<int>.Default);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Where1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Where<int>(default(IAsyncQueryable<int>), (int arg0) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Where<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Where<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0) => true);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Where2()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Where<int>(default(IAsyncQueryable<int>), (int arg0, int arg1) => true), ane => ane.ParamName == "source");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Where<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(Expression<Func<int, int, bool>>)), ane => ane.ParamName == "predicate");
+
+			var res = AsyncQueryable.Where<int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), (int arg0, int arg1) => true);
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+		[TestMethod]
+		public void Zip1()
+		{
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Zip<int, int, int>(default(IAsyncQueryable<int>), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "first");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Zip<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), default(IAsyncEnumerable<int>), (int arg0, int arg1) => default(int)), ane => ane.ParamName == "second");
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.Zip<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), default(Expression<Func<int, int, int>>)), ane => ane.ParamName == "selector");
+
+			var res = AsyncQueryable.Zip<int, int, int>(new int[] { default(int) }.ToAsyncEnumerable().AsAsyncQueryable(), new int[] { default(int) }.ToAsyncEnumerable(), (int arg0, int arg1) => default(int));
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+		}
+
+	}
+}

+ 474 - 0
Ix.NET/Source/Tests/AsyncQueryableTests.Generated.tt

@@ -0,0 +1,474 @@
+<#@ template debug="false" hostspecific="false" language="C#" #>
+<#@ assembly name="System.Core" #>
+<#@ assembly name="$(ProjectDir)\..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll" #>
+<#@ import namespace="System.Linq" #>
+<#@ import namespace="System.Text" #>
+<#@ import namespace="System.Threading" #>
+<#@ import namespace="System.Threading.Tasks" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ output extension=".cs" #>
+<#
+var failing = new[] { "TakeLast" };
+var exclude = new[] { "ForEach", "ForEachAsync", "ToEnumerable", "ToAsyncEnumerable", "ToObservable", "AsAsyncEnumerable" };
+
+var toQuotedImpl = default(Func<Type, int, bool, string>);
+toQuotedImpl = (t, i, b) =>
+{
+var name = t.Name;
+
+if (t.IsGenericType)
+{
+	var genDef = t.GetGenericTypeDefinition();
+	name = genDef.Name.Substring(0, genDef.Name.LastIndexOf('`'));
+
+	var genArgs = "<" + string.Join(", ", t.GetGenericArguments().Select(a => toQuotedImpl(a, i, false))) + ">";
+
+	if (b)
+	{
+		if (name == "Func" || name == "Action")
+		{
+			name = "Expression<" + name + genArgs + ">";
+		}
+		else if (name == "IAsyncEnumerable" && i == 0)
+		{
+			name = "IAsyncQueryable" + genArgs;
+		}
+		else if (name == "IOrderedAsyncEnumerable" && i == 0)
+		{
+			name = "IOrderedAsyncQueryable" + genArgs;
+		}
+		else
+		{
+			name += genArgs;
+		}
+	}
+	else
+	{
+		if (name == "Nullable")
+		{
+			name = genArgs.Substring(1, genArgs.Length - 2) + "?";
+		}
+		else
+		{
+			name += genArgs;
+		}
+	}
+}
+else if (t.IsArray)
+{
+	var elem = toQuotedImpl(t.GetElementType(), i, b);
+	name = elem + "[]";
+}
+else
+{
+	if (t == typeof(int))
+	{
+		name = "int";
+	}
+	else if (t == typeof(long))
+	{
+		name = "long";
+	}
+	else if (t == typeof(float))
+	{
+		name = "float";
+	}
+	else if (t == typeof(double))
+	{
+		name = "double";
+	}
+	else if (t == typeof(decimal))
+	{
+		name = "decimal";
+	}
+	else if (t == typeof(bool))
+	{
+		name = "bool";
+	}
+	else if (t == typeof(object))
+	{
+		name = "object";
+	}
+}
+
+return name;
+};
+
+var toQuoted = new Func<Type, int, string>((t, i) => toQuotedImpl(t, i, true));
+
+var index = new Dictionary<string, int>();
+#>
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace Tests
+{
+	[TestClass]
+	public class AsyncQueryableTests
+	{
+<#
+// NOTE: Just including extension methods
+foreach (var m in typeof(AsyncEnumerable).GetMethods()
+						.Where(m => m.IsStatic)
+						.Where(m => !exclude.Contains(m.Name))
+						.Where(m => m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true))
+						.Where(m =>
+						{
+							var p0 = m.GetParameters()[0].ParameterType;
+							if (p0.IsGenericType)
+							{
+								var p0d = p0.GetGenericTypeDefinition();
+								return p0d == typeof(IAsyncEnumerable<>) || p0d == typeof(IOrderedAsyncEnumerable<>);
+							}
+
+							return false;
+						})
+						.OrderBy(m => m.Name)
+						.ThenBy(m => m.GetParameters().Length))
+{
+	var genArgs = m.GetGenericArguments();
+
+	var ret = toQuoted(m.ReturnType, 0);
+	var name = m.Name;
+
+	if (genArgs.Length > 0)
+	{
+		name += "<" + string.Join(", ", genArgs.Select(a => a.Name)) + ">";
+	}
+
+	var isParams = false;
+	var parCount = m.GetParameters().Length;
+
+	if (parCount != 0)
+	{
+		if (m.GetParameters().Last().IsDefined(typeof(ParamArrayAttribute), true))
+		{
+			isParams = true;
+		}
+	}
+
+	var pars = string.Join(", ", m.GetParameters().Select((p, i) => (i == parCount - 1 && isParams ? "params " : "") + toQuoted(p.ParameterType, i) + " " + p.Name));
+
+	if (m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true))
+	{
+		pars = "this " + pars;
+	}
+
+	var mtd = "(MethodInfo)MethodBase.GetCurrentMethod()";
+
+	if (m.IsGenericMethod)
+	{
+		mtd = "(" + mtd + ").MakeGenericMethod(" + string.Join(", ", genArgs.Select(a => "typeof(" + a.Name + ")")) + ")";
+	}
+
+	var provider = m.GetParameters()[0].Name + ".Provider";
+	var factory = "";
+	var rem = "";
+	var cast = "";
+	var quotedArgs = new List<string>();
+
+	if (m.ReturnType.IsGenericType)
+	{
+		var td = m.ReturnType.GetGenericTypeDefinition();
+
+		if (td == typeof(Task<>))
+		{
+			factory = "ExecuteAsync<" + toQuotedImpl(m.ReturnType.GetGenericArguments()[0], -1, false) + ">";
+
+			var last = m.GetParameters().Last();
+			if (last.ParameterType == typeof(CancellationToken))
+			{
+				rem = ", " + last.Name;
+			}
+			else
+			{
+				rem = ", CancellationToken.None";
+			}
+		}
+		else if (td == typeof(IAsyncEnumerable<>) || td == typeof(IOrderedAsyncEnumerable<>))
+		{
+			factory = "CreateQuery<" + toQuotedImpl(m.ReturnType.GetGenericArguments()[0], -1, false) + ">";
+
+			if (td == typeof(IOrderedAsyncEnumerable<>))
+			{
+				cast = "(" + toQuoted(m.ReturnType, 0) + ")";
+			}
+		}
+	}
+
+	var n = 0;
+	foreach (var p in m.GetParameters())
+	{
+		var pt = p.ParameterType;
+
+		var add = false;
+
+		if (pt.IsGenericType)
+		{
+			var ptd = pt.GetGenericTypeDefinition();
+
+			if (ptd == typeof(IAsyncEnumerable<>) || ptd == typeof(IOrderedAsyncEnumerable<>))
+			{
+				if (n == 0)
+				{
+					quotedArgs.Add(p.Name + ".Expression");
+				}
+				else
+				{
+					quotedArgs.Add("GetSourceExpression(" + p.Name + ")");
+				}
+				add = true;
+			}
+			else if (ptd.Name.StartsWith("Func") || ptd.Name.StartsWith("Action"))
+			{
+				quotedArgs.Add(p.Name);
+				add = true;
+			}
+		}
+		
+		if (!add)
+		{
+			quotedArgs.Add("Expression.Constant(" + p.Name + ", typeof(" + toQuoted(pt, -1) + "))");
+		}
+
+		n++;
+	}
+
+	var expr = "Expression.Call(" + mtd + ", " + string.Join(", ", quotedArgs) + ")";
+
+	var testName = m.Name;
+
+	var num = 0;
+	if (!index.TryGetValue(testName, out num))
+	{
+		index[testName] = 0;
+	}
+
+	index[testName] = num + 1;
+
+	testName += (num + 1);
+#>
+		[TestMethod]
+		public void <#=testName#>()
+		{
+<#
+var indexes = new List<int>();
+var j = 0;
+foreach (var p in m.GetParameters())
+{
+	if (!p.ParameterType.IsValueType && !p.ParameterType.IsGenericParameter)
+	{
+		indexes.Add(j);
+	}
+
+	j++;
+}
+
+var tm = m;
+
+if (tm.IsGenericMethodDefinition)
+{
+	tm = m.MakeGenericMethod(m.GetGenericArguments().Select(a =>
+	{
+		var cs = a.GetGenericParameterConstraints();
+		if (cs.Length > 0)
+		{
+			var bc = cs.FirstOrDefault(c => c.IsClass);
+			if (bc != null)
+			{
+				return bc;
+			}
+		}
+
+		return typeof(int);
+	}).ToArray());
+}
+
+var opName = tm.Name;
+
+if (tm.IsGenericMethod)
+{
+	opName += "<" + string.Join(", ", tm.GetGenericArguments().Select(a => toQuotedImpl(a, -1, false))) + ">";
+}
+
+var getVal = default(Func<Type, int, string>);
+getVal = (tp, pos) =>
+{
+	if (tp.IsGenericType)
+	{
+		var tpd = tp.GetGenericTypeDefinition();
+
+		if (tpd == typeof(IAsyncEnumerable<>))
+		{
+			var tpa = tp.GetGenericArguments()[0];
+			var et = toQuotedImpl(tpa, -1, false);
+			var res = "new " + et + "[] { default(" + et + ") }.ToAsyncEnumerable()";
+
+			if (pos == 0)
+			{
+				res += ".AsAsyncQueryable()";
+			}
+
+			return res;
+		}
+		else if (tpd == typeof(IOrderedAsyncEnumerable<>))
+		{
+			var tpa = tp.GetGenericArguments()[0];
+			var res = "new " + toQuotedImpl(tpa, -1, false) + "[0].ToAsyncEnumerable()";
+
+			if (pos == 0)
+			{
+				res += ".AsAsyncQueryable()";
+			}
+
+			return res + ".OrderBy(x => x)";
+		}
+		else if (tpd.Name.StartsWith("Func"))
+		{
+			var inv = tp.GetMethod("Invoke");
+				
+			var largs = string.Join(", ", inv.GetParameters().Select((lp, lpi) => toQuoted(lp.ParameterType, -1) + " arg" + lpi).ToArray());
+
+			var lret = "default(" + toQuoted(inv.ReturnType, -1) + ")";
+
+			if (inv.ReturnType.IsGenericType)
+			{
+				if (inv.ReturnType.GetGenericTypeDefinition() == typeof(IAsyncEnumerable<>))
+				{
+					var tpa = inv.ReturnType.GetGenericArguments()[0];
+					var et = toQuotedImpl(tpa, -1, false);
+					lret = "new " + et + "[] { default(" + et + ") }.ToAsyncEnumerable()";
+				}
+			}
+			else if (inv.ReturnType == typeof(bool))
+			{
+				lret = "true";
+			}
+
+			return "(" + largs + ") => " + lret;
+		}
+		else if (tpd.Name.StartsWith("Action"))
+		{
+			var inv = tp.GetMethod("Invoke");
+				
+			var largs = string.Join(", ", inv.GetParameters().Select((lp, lpi) => toQuoted(lp.ParameterType, -1) + " arg" + lpi).ToArray());
+			var lret = "Console.WriteLine()";
+
+			return "(" + largs + ") => " + lret;
+		}
+		else if (tpd == typeof(IEqualityComparer<>))
+		{
+			var tpa = tp.GetGenericArguments()[0];
+
+			return "EqualityComparer<" + toQuotedImpl(tpa, -1, false) + ">.Default";
+		}
+		else if (tpd == typeof(IComparer<>))
+		{
+			var tpa = tp.GetGenericArguments()[0];
+
+			return "Comparer<" + toQuotedImpl(tpa, -1, false) + ">.Default";
+		}
+		else if (tpd == typeof(IObserver<>))
+		{
+			var tpa = tp.GetGenericArguments()[0];
+
+			return "new NopObserver<" + toQuotedImpl(tpa, -1, false) + ">()";
+		}
+	}
+	else if (tp == typeof(CancellationToken))
+	{
+		return "CancellationToken.None";
+	}
+	else if (tp == typeof(Action))
+	{
+		return "() => { }";
+	}
+	else if (tp.IsArray)
+	{
+		var tpa = tp.GetElementType();
+		var et = toQuotedImpl(tpa, -1, false);
+
+		return "new " + et + "[] { default(" + et + ") }";
+	}
+	else if (tp == typeof(int))
+	{
+		return "1";
+	}
+
+	return "default(" + toQuoted(tp, pos) + ")";
+};
+
+var vals = tm.GetParameters().Select((p, i) => getVal(p.ParameterType, i)).ToArray();
+var nulls = tm.GetParameters().Select((p, i) => "default(" + toQuoted(p.ParameterType, i) + ")").ToArray();
+
+var len = vals.Length;
+
+if (indexes.Count != 0)
+{
+	foreach (var idx in indexes)
+	{
+		var args = string.Join(", ", Enumerable.Range(0, len).Select(k => k == idx ? nulls[k] : vals[k]).ToArray());
+		var nullArg = tm.GetParameters()[idx].Name;
+#>
+			AssertEx.Throws<ArgumentNullException>(() => AsyncQueryable.<#=opName#>(<#=args#>), ane => ane.ParamName == "<#=nullArg#>");
+<#
+	}
+#>
+
+<#
+}
+
+{
+	var args = string.Join(", ", vals);
+#>
+			var res = AsyncQueryable.<#=opName#>(<#=args#>);
+<#
+	var tmRet = tm.ReturnType;
+
+	if (tmRet.IsGenericType)
+	{
+		tmRet = tmRet.GetGenericTypeDefinition();
+	}
+
+	if (tm.Name == "Repeat" || tm.Name == "Expand")
+	{
+#>
+			res = res.Take(5);
+<#
+	}
+
+	if (!failing.Contains(tm.Name))
+	{
+		if (tmRet == typeof(Task<>))
+		{
+#>
+			AssertEx.SucceedOrFailProper(() => res.Wait());
+<#
+		}
+		else if (tmRet == typeof(IAsyncEnumerable<>))
+		{
+#>
+			var task = res.ForEachAsync(_ => { });
+			AssertEx.SucceedOrFailProper(() => task.Wait());
+<#
+		}
+	}
+	else
+	{
+#>
+			// TODO: investigate test hang
+<#
+	}
+}
+#>
+		}
+
+<#
+}
+#>
+	}
+}

+ 19 - 0
Ix.NET/Source/Tests/NopObserver.cs

@@ -0,0 +1,19 @@
+using System;
+
+namespace Tests
+{
+    public class NopObserver<T> : IObserver<T>
+    {
+        public void OnCompleted()
+        {
+        }
+
+        public void OnError(Exception error)
+        {
+        }
+
+        public void OnNext(T value)
+        {
+        }
+    }
+}

+ 10 - 0
Ix.NET/Source/Tests/Tests.csproj

@@ -68,6 +68,8 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="App.cs" />
+    <Compile Include="AssertEx.cs" />
+    <Compile Include="AsyncQueryableTests.Generated.cs" />
     <Compile Include="AsyncTests.Creation.cs" />
     <Compile Include="AsyncTests.cs" />
     <Compile Include="AsyncTests.Conversions.cs" />
@@ -76,6 +78,7 @@
     <Compile Include="AsyncTests.Aggregates.cs" />
     <Compile Include="AsyncTests.Bugs.cs" />
     <Compile Include="AsyncTests.Exceptions.cs" />
+    <Compile Include="NopObserver.cs" />
     <Compile Include="TaskExtTests.cs" />
     <Compile Include="Tests.Imperative.cs" />
     <Compile Include="Tests.Qbservable.cs" />
@@ -89,6 +92,10 @@
     <Compile Include="Tests.Aggregates.cs" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\System.Interactive.Async.Providers\System.Interactive.Async.Providers.csproj">
+      <Project>{b0350cd4-37f7-4508-b67f-d4bb3b9092aa}</Project>
+      <Name>System.Interactive.Async.Providers</Name>
+    </ProjectReference>
     <ProjectReference Include="..\System.Interactive.Async\System.Interactive.Async.csproj" Condition=" '$(BuildFlavor)' == 'DESKTOPCLR40' Or '$(BuildFlavor)' == 'DESKTOPCLR45' ">
       <Project>{7269A578-326A-4C3E-9874-A2D2600095BC}</Project>
       <Name>System.Interactive.Async</Name>
@@ -102,5 +109,8 @@
       <Name>System.Interactive</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
+  </ItemGroup>
   <Import Project="..\Import.targets" />
 </Project>