Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

QueryableExtensions::AllAsync Method

Entity Framework 6.0
 

Asynchronously determines whether all the elements of a sequence satisfy a condition.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAllAsync<TSource>(IQueryable<TSource>^, Expression<Func<TSource, Boolean>^>^)

Asynchronously determines whether all the elements of a sequence satisfy a condition.

System_CAPS_pubmethodSystem_CAPS_staticAllAsync<TSource>(IQueryable<TSource>^, Expression<Func<TSource, Boolean>^>^, CancellationToken)

Asynchronously determines whether all the elements of a sequence satisfy a condition.

Return to top

QueryableExtensions::AllAsync<TSource> Method (IQueryable<TSource>^, Expression<Func<TSource, Boolean>^>^)

Asynchronously determines whether all the elements of a sequence satisfy a condition.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<bool>^ AllAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, bool>^>^ predicate
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> whose elements to test for a condition.

predicate
Type: System.Linq.Expressions::Expression<Func<TSource, Boolean>^>^

A function to test each element for a condition.

Return Value

Type: System.Threading.Tasks::Task<Boolean>^

A task that represents the asynchronous operation. The task result contains true if every element of the source sequence passes the test in the specified predicate; otherwise, false.

Type Parameters

TSource

The type of the elements of source.

Exception Condition
ArgumentNullException

source or predicate is null.

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::AllAsync<TSource> Method (IQueryable<TSource>^, Expression<Func<TSource, Boolean>^>^, CancellationToken)

Asynchronously determines whether all the elements of a sequence satisfy a condition.

public:
generic<typename TSource>
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<bool>^ AllAsync(
	IQueryable<TSource>^ source,
	Expression<Func<TSource, bool>^>^ predicate,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> whose elements to test for a condition.

predicate
Type: System.Linq.Expressions::Expression<Func<TSource, Boolean>^>^

A function to test each element for a condition.

cancellationToken
Type: System.Threading::CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks::Task<Boolean>^

A task that represents the asynchronous operation. The task result contains true if every element of the source sequence passes the test in the specified predicate; otherwise, false.

Type Parameters

TSource

The type of the elements of source.

Exception Condition
ArgumentNullException

source or predicate is null .

InvalidOperationException

source does not implement IDbAsyncQueryProvider .

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top
Show: