Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

QueryableExtensions::ForEachAsync Method

Entity Framework 6.0
 

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.

Return to top

QueryableExtensions::ForEachAsync Method (IQueryable^, Action<Object^>^)

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

public:
[ExtensionAttribute]
static Task^ ForEachAsync(
	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.

Return to top

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

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

public:
[ExtensionAttribute]
static Task^ ForEachAsync(
	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.

Return to top

QueryableExtensions::ForEachAsync<T> Method (IQueryable<T>^, Action<T>^)

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

public:
generic<typename T>
[ExtensionAttribute]
static Task^ ForEachAsync(
	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.

Return to top

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

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

public:
generic<typename T>
[ExtensionAttribute]
static Task^ ForEachAsync(
	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.

Return to top
Show: