AsyncEnumerable.ToArrayAsync<TSource> Methode

Definitie

Hiermee maakt u een matrix op basis van een IAsyncEnumerable<T>.

public static System.Threading.Tasks.ValueTask<TSource[]> ToArrayAsync<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, System.Threading.CancellationToken cancellationToken = default);
static member ToArrayAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Source[]>
<Extension()>
Public Function ToArrayAsync(Of TSource) (source As IAsyncEnumerable(Of TSource), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TSource())

Type parameters

TSource

Het type van de elementen van de bron.

Parameters

source
IAsyncEnumerable<TSource>

Een IEnumerable<T> om een matrix van te maken.

cancellationToken
CancellationToken

De CancellationToken te controleren op annuleringsaanvragen. De standaardwaarde is None.

Retouren

ValueTask<TSource[]>

Een matrix die de elementen uit de invoerreeks bevat.

Uitzonderingen

source is null.

Van toepassing op