Open sandboxFocus

Method AsAsyncEnumerable

AsAsyncEnumerable<T>(Task<IAsyncEnumerable<T>>)

If task is already completed, returns the result of the task; otherwise, returns an instance of IAsyncEnumerable<T> which awaits the task in MoveNextAsync() then creates and delegates to an enumerator from the result of the task.

Declaration
public static IAsyncEnumerable<T> AsAsyncEnumerable<T>(this Task<IAsyncEnumerable<T>> task)
Parameters
Type Name Description
Task<IAsyncEnumerable<T>> task
Returns
Type Description
IAsyncEnumerable<T>
Type Parameters
Name Description
T

AsAsyncEnumerable<T>(ValueTask<IAsyncEnumerable<T>?>)

If task is already completed, returns the result of the task; otherwise, returns an instance of IAsyncEnumerable<T> which awaits the task in MoveNextAsync() then creates and delegates to an enumerator from the result of the task.

Declaration
public static IAsyncEnumerable<T>? AsAsyncEnumerable<T>(this ValueTask<IAsyncEnumerable<T>?> task)
Parameters
Type Name Description
ValueTask<IAsyncEnumerable<T>> task
Returns
Type Description
IAsyncEnumerable<T>
Type Parameters
Name Description
T