Method ToListAsync
ToListAsync<TDocument>(IAsyncCursor<TDocument>, CancellationToken)
Returns a list containing all the documents returned by a cursor.
public static Task<List<TDocument>> ToListAsync<TDocument>(this IAsyncCursor<TDocument> source, CancellationToken cancellationToken = default)
Parameters
source
IAsyncCursor<TDocument>The source.
cancellationToken
CancellationTokenThe cancellation token.
Returns
Type Parameters
TDocument
The type of the document.