QueryableExtensions::ForEachAsync Method
Asynchronously enumerates the query results and performs the specified action on each element.
Assembly: EntityFramework (in EntityFramework.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | ForEachAsync(IQueryable^, Action<Object^>^) | Asynchronously enumerates the query results and performs the specified action on each element. |
![]() ![]() | ForEachAsync(IQueryable^, Action<Object^>^, CancellationToken) | Asynchronously enumerates the query results and performs the specified action on each element. |
![]() ![]() | ForEachAsync<T>(IQueryable<T>^, Action<T>^) | Asynchronously enumerates the query results and performs the specified action on each element. |
![]() ![]() | ForEachAsync<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: [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.
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: [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.
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: 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.
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: 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.
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.

