DbRawSqlQuery.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<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. |
ForEachAsync(Action<Object>)
Asynchronously enumerates the query results and performs the specified action on each element.
public virtual System.Threading.Tasks.Task ForEachAsync (Action<object> action);
abstract member ForEachAsync : Action<obj> -> System.Threading.Tasks.Task
override this.ForEachAsync : Action<obj> -> System.Threading.Tasks.Task
Public Overridable Function ForEachAsync (action As Action(Of Object)) As Task
Parameters
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<Object>, CancellationToken)
Asynchronously enumerates the query results and performs the specified action on each element.
public virtual System.Threading.Tasks.Task ForEachAsync (Action<object> action, System.Threading.CancellationToken cancellationToken);
abstract member ForEachAsync : Action<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.ForEachAsync : Action<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Parameters
- 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.
Applies to
Entity Framework