DbRawSqlQuery.ForEachAsync Method
Asynchronously enumerates the query results and performs the specified action on each element.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | ForEachAsync(Action<Object>) | Asynchronously enumerates the query results and performs the specified action on each element. |
![]() | ForEachAsync(Action<Object>, CancellationToken) | Asynchronously enumerates the query results and performs the specified action on each element. |
DbRawSqlQuery.ForEachAsync Method (Action<Object>)
Asynchronously enumerates the query results and performs the specified action on each element.
Parameters
- action
-
Type:
System.Action<Object>
The action to perform on each element.
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.ForEachAsync Method (Action<Object>, CancellationToken)
Asynchronously enumerates the query results and performs the specified action on each element.
public virtual Task ForEachAsync( Action<object> action, CancellationToken cancellationToken )
Parameters
- action
-
Type:
System.Action<Object>
The action to perform on each element.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A CancellationToken to observe while waiting for the task to complete.
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.