QueryableExtensions.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(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>, 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(IQueryable, Action<Object>)
Asynchronously enumerates the query results and performs the specified action on each element.
public static System.Threading.Tasks.Task ForEachAsync (this System.Linq.IQueryable source, Action<object> action);
static member ForEachAsync : System.Linq.IQueryable * Action<obj> -> System.Threading.Tasks.Task
<Extension()>
Public Function ForEachAsync (source As IQueryable, action As Action(Of Object)) As Task
Parameters
- source
- IQueryable
An IQueryable to enumerate.
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(IQueryable, Action<Object>, CancellationToken)
Asynchronously enumerates the query results and performs the specified action on each element.
public static System.Threading.Tasks.Task ForEachAsync (this System.Linq.IQueryable source, Action<object> action, System.Threading.CancellationToken cancellationToken);
static member ForEachAsync : System.Linq.IQueryable * Action<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Parameters
- source
- IQueryable
An IQueryable to enumerate.
- 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
ForEachAsync<T>(IQueryable<T>, Action<T>, CancellationToken)
Asynchronously enumerates the query results and performs the specified action on each element.
public static System.Threading.Tasks.Task ForEachAsync<T> (this System.Linq.IQueryable<T> source, Action<T> action, System.Threading.CancellationToken cancellationToken);
static member ForEachAsync : System.Linq.IQueryable<'T> * Action<'T> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Type Parameters
- T
The type of the elements of source
.
Parameters
- source
- IQueryable<T>
An IQueryable<T> to enumerate.
- action
- Action<T>
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
ForEachAsync<T>(IQueryable<T>, Action<T>)
Asynchronously enumerates the query results and performs the specified action on each element.
public static System.Threading.Tasks.Task ForEachAsync<T> (this System.Linq.IQueryable<T> source, Action<T> action);
static member ForEachAsync : System.Linq.IQueryable<'T> * Action<'T> -> System.Threading.Tasks.Task
<Extension()>
Public Function ForEachAsync(Of T) (source As IQueryable(Of T), action As Action(Of T)) As Task
Type Parameters
- T
The type of the elements of source
.
Parameters
- source
- IQueryable<T>
An IQueryable<T> to enumerate.
- action
- Action<T>
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
Entity Framework