Share via


DbRawSqlQuery<TElement>.AllAsync Method

Definition

Overloads

AllAsync(Func<TElement,Boolean>)

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

AllAsync(Func<TElement,Boolean>, CancellationToken)

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

AllAsync(Func<TElement,Boolean>)

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

public System.Threading.Tasks.Task<bool> AllAsync (Func<TElement,bool> predicate);
member this.AllAsync : Func<'Element, bool> -> System.Threading.Tasks.Task<bool>
Public Function AllAsync (predicate As Func(Of TElement, Boolean)) As Task(Of Boolean)

Parameters

predicate
Func<TElement,Boolean>

A function to test each element for a condition.

Returns

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

Exceptions

predicate is null .

Remarks

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.

Applies to

AllAsync(Func<TElement,Boolean>, CancellationToken)

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

public System.Threading.Tasks.Task<bool> AllAsync (Func<TElement,bool> predicate, System.Threading.CancellationToken cancellationToken);
member this.AllAsync : Func<'Element, bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>

Parameters

predicate
Func<TElement,Boolean>

A function to test each element for a condition.

cancellationToken
CancellationToken

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

Returns

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

Exceptions

predicate is null .

Remarks

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.

Applies to