Method ToEnumerable

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

ToEnumerable(IAsyncCursor, CancellationToken)

Wraps a cursor in an IEnumerable that can be enumerated one time.

public static IEnumerable<TDocument> ToEnumerable<TDocument>(this IAsyncCursor<TDocument> cursor, CancellationToken cancellationToken = default)

Parameters

cursor IAsyncCursor

The cursor.

cancellationToken CancellationToken

The cancellation token.

Returns

IEnumerable

An IEnumerable

Type Parameters

TDocument

The type of the document.