DbRawSqlQuery<TElement>.AllAsync Method
Asynchronously determines whether all the elements of the query satisfy a condition.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | 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. |
DbRawSqlQuery<TElement>.AllAsync Method (Func<TElement, Boolean>)
Asynchronously determines whether all the elements of the query satisfy a condition.
Parameters
- predicate
-
Type:
System.Func<TElement, 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 query result passes the test in the specified predicate; otherwise, false.
Exception | Condition |
---|---|
ArgumentNullException | predicate is null . |
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.
DbRawSqlQuery<TElement>.AllAsync Method (Func<TElement, Boolean>, CancellationToken)
Asynchronously determines whether all the elements of the query satisfy a condition.
public Task<bool> AllAsync( Func<TElement, bool> predicate, CancellationToken cancellationToken )
Parameters
- predicate
-
Type:
System.Func<TElement, 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 query result passes the test in the specified predicate; otherwise, false.
Exception | Condition |
---|---|
ArgumentNullException | predicate is null . |
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.