Table of Contents

Method ToEnumerable

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Core.dll

ToEnumerable<TDocument>(IAsyncCursor<TDocument>, 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<TDocument>

The cursor.

cancellationToken CancellationToken

The cancellation token.

Returns

IEnumerable<TDocument>

An IEnumerable

Type Parameters

TDocument

The type of the document.