MetalamaAPI documentationAspect APIMetalama.​Framework.​Run­TimeRun­Time­Aspect­HelperBuffer­To­List­Async
Open sandboxFocus

RunTimeAspectHelper.BufferToListAsync Method

BufferToListAsync<T>(IAsyncEnumerator<T>, CancellationToken)

Evaluates an IAsyncEnumerator<T>, stores the result into an AsyncEnumerableList<T> and returns the list. If the enumerator is already an AsyncEnumerableList<T> enumerator, returns the parent AsyncEnumerableList<T>. The intended side effect of this method is to completely evaluate the input enumerator.

public static ValueTask<AsyncEnumerableList<T>> BufferToListAsync<T>(this IAsyncEnumerator<T> enumerator, CancellationToken cancellationToken = null)
Type Name Description
IAsyncEnumerator<T> enumerator

An enumerator.

CancellationToken cancellationToken

A cancellation token.

Type Description

An AsyncEnumerableList<T> made from the items of enumerator, or the parent AsyncEnumerableList<T> object if the enumerator object itself it is already an AsyncEnumerableList<T> enumerator.

Type Parameters
Name Description