AsyncEnumerable.ToArrayAsync 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.
Creates an array from an IAsyncEnumerable
public static System.Threading.Tasks.ValueTask ToArrayAsync(this System.Collections.Generic.IAsyncEnumerable source, System.Threading.CancellationToken cancellationToken = default);
static member ToArrayAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Source[]>
Public Function ToArrayAsync(Of TSource) (source As IAsyncEnumerable(Of TSource), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TSource())
Type Parameters
- TSource
The type of the elements of source.
Parameters
- source
-
IAsyncEnumerable
An IEnumerable
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
An array that contains the elements from the input sequence.
Exceptions
source is null.