MetalamaAPI documentationPatterns APIMetalama.​Patterns.​Caching.​Aspects.​HelpersAsync­Enumerable­HelperAs­Async­Enumerable
Open sandboxFocus

AsyncEnumerableHelper.AsAsyncEnumerable Method

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

If task is already completed, returns the result of the task; otherwise, returns an instance of System.Collections.Generic.IAsyncEnumerable<> 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
System.Threading.Tasks.Task<System.Collections.Generic.IAsyncEnumerable<T>> task
Returns
Type Description
System.Collections.Generic.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 System.Collections.Generic.IAsyncEnumerable<> 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
System.Threading.Tasks.ValueTask<System.Collections.Generic.IAsyncEnumerable<T>> task
Returns
Type Description
System.Collections.Generic.IAsyncEnumerable<T>
Type Parameters
Name Description
T