QueryableExtensions.ForEachAsync Method

 

Asynchronously enumerates the query results and performs the specified action on each element.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticForEachAsync(IQueryable, Action<Object>)

Asynchronously enumerates the query results and performs the specified action on each element.

System_CAPS_pubmethodSystem_CAPS_staticForEachAsync(IQueryable, Action<Object>, CancellationToken)

Asynchronously enumerates the query results and performs the specified action on each element.

System_CAPS_pubmethodSystem_CAPS_staticForEachAsync<T>(IQueryable<T>, Action<T>)

Asynchronously enumerates the query results and performs the specified action on each element.

System_CAPS_pubmethodSystem_CAPS_staticForEachAsync<T>(IQueryable<T>, Action<T>, CancellationToken)

Asynchronously enumerates the query results and performs the specified action on each element.


QueryableExtensions.ForEachAsync Method (IQueryable, Action<Object>)

Asynchronously enumerates the query results and performs the specified action on each element.

public static Task ForEachAsync(
	this IQueryable source,
	Action<object> action
)

Parameters

source
Type: System.Linq.IQueryable

An IQueryable to enumerate.

action
Type: System.Action<Object>

The action to perform on each element.

Return Value

Type: System.Threading.Tasks.Task

A task that represents the asynchronous operation.

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.


QueryableExtensions.ForEachAsync Method (IQueryable, Action<Object>, CancellationToken)

Asynchronously enumerates the query results and performs the specified action on each element.

public static Task ForEachAsync(
	this IQueryable source,
	Action<object> action,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq.IQueryable

An IQueryable to enumerate.

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.

Return Value

Type: System.Threading.Tasks.Task

A task that represents the asynchronous operation.

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.


QueryableExtensions.ForEachAsync<T> Method (IQueryable<T>, Action<T>)

Asynchronously enumerates the query results and performs the specified action on each element.

public static Task ForEachAsync<T>(
	this IQueryable<T> source,
	Action<T> action
)

Parameters

source
Type: System.Linq.IQueryable<T>

An IQueryable<T> to enumerate.

action
Type: System.Action<T>

The action to perform on each element.

Return Value

Type: System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Type Parameters

T

The type of the elements of source.

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.


QueryableExtensions.ForEachAsync<T> Method (IQueryable<T>, Action<T>, CancellationToken)

Asynchronously enumerates the query results and performs the specified action on each element.

public static Task ForEachAsync<T>(
	this IQueryable<T> source,
	Action<T> action,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq.IQueryable<T>

An IQueryable<T> to enumerate.

action
Type: System.Action<T>

The action to perform on each element.

cancellationToken
Type: System.Threading.CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Type Parameters

T

The type of the elements of source.

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.