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
source
IAsyncCursorSource<TDocument>The source.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- IEnumerable<TDocument>
An IEnumerable.
Type Parameters
TDocument
The type of the document.