// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. #if !NET40 namespace System.Data.Entity.Infrastructure { using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; public static class IDbAsyncQueryProviderExtensions { /// /// Asynchronously executes the query represented by a specified expression tree. /// /// A Task containing the value that results from executing the specified query. /// An expression tree that represents a LINQ query. /// The token to monitor for cancellation requests. public static Task ExecuteAsync(this IDbAsyncQueryProvider provider, Expression expression) { return provider.ExecuteAsync(expression, CancellationToken.None); } /// /// Asynchronously executes the strongly-typed query represented by a specified expression tree. /// /// A Task containing the value that results from executing the specified query. /// An expression tree that represents a LINQ query. /// The type of the value that results from executing the query. /// The token to monitor for cancellation requests. public static Task ExecuteAsync(this IDbAsyncQueryProvider provider, Expression expression) { return provider.ExecuteAsync(expression, CancellationToken.None); } } } #endif