Method ToAsyncEnumerable
ToAsyncEnumerable<TDocument>(IAsyncCursorSource<TDocument>)
Wraps a cursor source in an IAsyncEnumerable. Each time GetAsyncEnumerator is called a new enumerator is returned and a new cursor is fetched from the cursor source on the first call to MoveNextAsync.
public static IAsyncEnumerable<TDocument> ToAsyncEnumerable<TDocument>(this IAsyncCursorSource<TDocument> source)
Parameters
source
IAsyncCursorSource<TDocument>The source.
Returns
- IAsyncEnumerable<TDocument>
An IAsyncEnumerable.
Type Parameters
TDocument
The type of the document.