PagedEnumerableExtensions.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<T>(IPagedEnumerable<T>, Action<T>, CancellationToken) |
Iterates over an IPagedEnumerable<T> sequence, invoking a synchronous delegate for each element. |
ForEachAsync<T>(IPagedEnumerable<T>, Func<T,CancellationToken,Task>, CancellationToken) |
Iterates over an IPagedEnumerable<T> sequence, invoking an asynchronous delegate for each element. |
ForEachAsync<T>(IPagedEnumerable<T>, Func<T,Task>, CancellationToken) |
Iterates over an IPagedEnumerable<T> sequence, invoking an asynchronous delegate for each element. |
ForEachAsync<T>(IPagedEnumerable<T>, Action<T>, CancellationToken)
- Source:
- PagedEnumerableExtensions.cs
Iterates over an IPagedEnumerable<T> sequence, invoking a synchronous delegate for each element.
public static System.Threading.Tasks.Task ForEachAsync<T> (this Microsoft.Azure.Batch.IPagedEnumerable<T> source, Action<T> body, System.Threading.CancellationToken cancellationToken = default);
static member ForEachAsync : Microsoft.Azure.Batch.IPagedEnumerable<'T> * Action<'T> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function ForEachAsync(Of T) (source As IPagedEnumerable(Of T), body As Action(Of T), Optional cancellationToken As CancellationToken = Nothing) As Task
Type Parameters
- T
Parameters
- source
- IPagedEnumerable<T>
The IPagedEnumerable<T> to iterate over.
- body
- Action<T>
The delegate to execute for each element in source
.
- cancellationToken
- CancellationToken
A CancellationToken for controlling the lifetime of the asynchronous operation.
Returns
A Task that represents the iteration operation. The task completes when iteration is complete.
Remarks
This method processes elements sequentially, not concurrently. That is, for each element in the sequence, the method completes execution of the delegate before processing the next element.
Applies to
ForEachAsync<T>(IPagedEnumerable<T>, Func<T,CancellationToken,Task>, CancellationToken)
- Source:
- PagedEnumerableExtensions.cs
Iterates over an IPagedEnumerable<T> sequence, invoking an asynchronous delegate for each element.
public static System.Threading.Tasks.Task ForEachAsync<T> (this Microsoft.Azure.Batch.IPagedEnumerable<T> source, Func<T,System.Threading.CancellationToken,System.Threading.Tasks.Task> body, System.Threading.CancellationToken cancellationToken = default);
static member ForEachAsync : Microsoft.Azure.Batch.IPagedEnumerable<'T> * Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.Task> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function ForEachAsync(Of T) (source As IPagedEnumerable(Of T), body As Func(Of T, CancellationToken, Task), Optional cancellationToken As CancellationToken = Nothing) As Task
Type Parameters
- T
Parameters
- source
- IPagedEnumerable<T>
The IPagedEnumerable<T> to iterate over.
- body
- Func<T,CancellationToken,Task>
The asynchronous delegate to execute for each element in source
.
- cancellationToken
- CancellationToken
A CancellationToken for controlling the lifetime of the asynchronous operation.
Returns
A Task that represents the iteration operation. The task completes when iteration is complete.
Remarks
This method processes elements sequentially, not concurrently. That is, for each element in the sequence, the method awaits the asynchronous delegate before processing the next element.
Applies to
ForEachAsync<T>(IPagedEnumerable<T>, Func<T,Task>, CancellationToken)
- Source:
- PagedEnumerableExtensions.cs
Iterates over an IPagedEnumerable<T> sequence, invoking an asynchronous delegate for each element.
public static System.Threading.Tasks.Task ForEachAsync<T> (this Microsoft.Azure.Batch.IPagedEnumerable<T> source, Func<T,System.Threading.Tasks.Task> body, System.Threading.CancellationToken cancellationToken = default);
static member ForEachAsync : Microsoft.Azure.Batch.IPagedEnumerable<'T> * Func<'T, System.Threading.Tasks.Task> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function ForEachAsync(Of T) (source As IPagedEnumerable(Of T), body As Func(Of T, Task), Optional cancellationToken As CancellationToken = Nothing) As Task
Type Parameters
- T
Parameters
- source
- IPagedEnumerable<T>
The IPagedEnumerable<T> to iterate over.
- cancellationToken
- CancellationToken
A CancellationToken for controlling the lifetime of the asynchronous operation.
Returns
A Task that represents the iteration operation. The task completes when iteration is complete.
Remarks
This method processes elements sequentially, not concurrently. That is, for each element in the sequence, the method awaits the asynchronous delegate before processing the next element.
Applies to
Azure SDK for .NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기