DbRawSqlQuery<TElement>.ForEachAsync Method     
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| ForEachAsync(Action<TElement>) | Asynchronously enumerates the query results and performs the specified action on each element. | 
| ForEachAsync(Action<TElement>, CancellationToken) | Asynchronously enumerates the query results and performs the specified action on each element. | 
ForEachAsync(Action<TElement>)
Asynchronously enumerates the query results and performs the specified action on each element.
public System.Threading.Tasks.Task ForEachAsync(Action<TElement> action);member this.ForEachAsync : Action<'Element> -> System.Threading.Tasks.TaskPublic Function ForEachAsync (action As Action(Of TElement)) As TaskParameters
- action
- Action<TElement>
The action to be executed.
Returns
A task that represents the asynchronous operation.
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
ForEachAsync(Action<TElement>, CancellationToken)
Asynchronously enumerates the query results and performs the specified action on each element.
public System.Threading.Tasks.Task ForEachAsync(Action<TElement> action, System.Threading.CancellationToken cancellationToken);member this.ForEachAsync : Action<'Element> * System.Threading.CancellationToken -> System.Threading.Tasks.TaskParameters
- action
- Action<TElement>
The action to be executed.
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
A task that represents the asynchronous operation.
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.