你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

AsyncExtensions.WhenAllForAwait Method

Definition

Overloads

WhenAllForAwait(IEnumerable<Task>)

Creates a task that will complete when all of the supplied tasks have completed. Multiple exceptions will be wrapped as single aggregate exception. This extension method is intend to be used with await operator exclusively.

WhenAllForAwait<T>(IEnumerable<Task<T>>)

Creates a task that will complete when all of the supplied tasks have completed. Multiple exceptions will be wrapped as single aggregate exception. This extension method is intend to be used with await operator exclusively.

WhenAllForAwait(IEnumerable<Task>)

Creates a task that will complete when all of the supplied tasks have completed. Multiple exceptions will be wrapped as single aggregate exception. This extension method is intend to be used with await operator exclusively.

public static System.Threading.Tasks.Task WhenAllForAwait (this System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task> tasks);
static member WhenAllForAwait : seq<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task
<Extension()>
Public Function WhenAllForAwait (tasks As IEnumerable(Of Task)) As Task

Parameters

tasks
IEnumerable<Task>

The asynchronous tasks.

Returns

Applies to

WhenAllForAwait<T>(IEnumerable<Task<T>>)

Creates a task that will complete when all of the supplied tasks have completed. Multiple exceptions will be wrapped as single aggregate exception. This extension method is intend to be used with await operator exclusively.

public static System.Threading.Tasks.Task<T[]> WhenAllForAwait<T> (this System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task<T>> tasks);
static member WhenAllForAwait : seq<System.Threading.Tasks.Task<'T>> -> System.Threading.Tasks.Task<'T[]>
<Extension()>
Public Function WhenAllForAwait(Of T) (tasks As IEnumerable(Of Task(Of T))) As Task(Of T())

Type Parameters

T

The type of the result produced by task.

Parameters

tasks
IEnumerable<Task<T>>

The asynchronous tasks.

Returns

Task<T[]>

Applies to