Share via


DbRawSqlQuery.ForEachAsync Method

Definition

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

action
Action<Object>

The action to perform on each element.

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

action
Action<Object>

The action to perform on each element.

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