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