src/Shared/EntityFramework/Infrastructure/IDbAsyncEnumerableExtensions.cs
// <summary>
// Asynchronously creates a <see cref="List{T}" /> from the <see cref="IDbAsyncEnumerable" />.
// </summary>
// <typeparam name="T"> The type that the elements will be cast to. </typeparam>
// <param name="cancellationToken"> The token to monitor for cancellation requests. </param>
// <returns>
// A <see cref="Task" /> containing a <see cref="List{T}" /> that contains elements from the input sequence.
// </returns>
Asynchronously creates a  from the .
Asynchronously creates a from the .
internal static async Task<List<T>> ToListAsync<T>(this IDbAsyncEnumerable source, CancellationToken cancellationToken)
        {
            DebugCheck.NotNull(source);
            var list = new List<T>();
            await source.ForEachAsync(e => list.Add((T)e), cancellationToken).WithCurrentCulture();
            return list;
        }
internal static async Task < List < T > > ToListAsync < T > ( this IDbAsyncEnumerable source , CancellationToken cancellationToken ) { DebugCheck . NotNull ( source ) ; var list = new List < T > ( ) ; await source . ForEachAsync ( e => list . Add ( ( T ) e ) , cancellationToken ) . WithCurrentCulture ( ) ; return list ; }
Asynchronously creates a  from the .
Asynchronously creates a from the .
A  containing a  that contains elements from the input sequence.
A containing a that contains elements from the input sequence .
IDbAsyncEnumerable
this
cancellationToken
CancellationToken
The token to monitor for cancellation requests.
The token to monitor for cancellation requests .
typeparam
The type that the elements will be cast to.
The type that the elements will be cast to .