Method ToEnumerable
ToEnumerable<TDocument>(IAsyncCursorSource<TDocument>, CancellationToken)
Wraps a cursor source in an IEnumerable. Each time GetEnumerator is called a new cursor is fetched from the cursor source.
public static IEnumerable<TDocument> ToEnumerable<TDocument>(this IAsyncCursorSource<TDocument> source, CancellationToken cancellationToken = default)
Parameters
sourceIAsyncCursorSource<TDocument>The source.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- IEnumerable<TDocument>
An IEnumerable.
Type Parameters
TDocumentThe type of the document.