Method ToListAsync
ToListAsync<TSource>(IQueryable<TSource>, CancellationToken)
Executes the LINQ query and returns a list of the results.
public static Task<List<TSource>> ToListAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = default)
Parameters
sourceIQueryable<TSource>The sequence to return elements from.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Type Parameters
TSourceThe type of the elements of
source.