Table of Contents

Class OperationExtensionMethods

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

Represents extension methods for operations.

public static class OperationExtensionMethods
Inheritance
OperationExtensionMethods
Inherited Members

Methods

ExecuteAsync<TResult>(IReadOperation<TResult>, IChannelSourceHandle, ReadPreference, ICoreSessionHandle, CancellationToken)

Executes a read operation using a channel source.

public static Task<TResult> ExecuteAsync<TResult>(this IReadOperation<TResult> operation, IChannelSourceHandle channelSource, ReadPreference readPreference, ICoreSessionHandle session, CancellationToken cancellationToken)

Parameters

operation IReadOperation<TResult>

The read operation.

channelSource IChannelSourceHandle

The channel source.

readPreference ReadPreference

The read preference.

session ICoreSessionHandle

The session.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResult>

A Task whose result is the result of the operation.

Type Parameters

TResult

The type of the result.

ExecuteAsync<TResult>(IWriteOperation<TResult>, IChannelSourceHandle, ICoreSessionHandle, CancellationToken)

Executes a write operation using a channel source.

public static Task<TResult> ExecuteAsync<TResult>(this IWriteOperation<TResult> operation, IChannelSourceHandle channelSource, ICoreSessionHandle session, CancellationToken cancellationToken)

Parameters

operation IWriteOperation<TResult>

The write operation.

channelSource IChannelSourceHandle

The channel source.

session ICoreSessionHandle

The session.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResult>

A Task whose result is the result of the operation.

Type Parameters

TResult

The type of the result.

Execute<TResult>(IReadOperation<TResult>, IChannelSourceHandle, ReadPreference, ICoreSessionHandle, CancellationToken)

Executes a read operation using a channel source.

public static TResult Execute<TResult>(this IReadOperation<TResult> operation, IChannelSourceHandle channelSource, ReadPreference readPreference, ICoreSessionHandle session, CancellationToken cancellationToken)

Parameters

operation IReadOperation<TResult>

The read operation.

channelSource IChannelSourceHandle

The channel source.

readPreference ReadPreference

The read preference.

session ICoreSessionHandle

The session.

cancellationToken CancellationToken

The cancellation token.

Returns

TResult

The result of the operation.

Type Parameters

TResult

The type of the result.

Execute<TResult>(IWriteOperation<TResult>, IChannelSourceHandle, ICoreSessionHandle, CancellationToken)

Executes a write operation using a channel source.

public static TResult Execute<TResult>(this IWriteOperation<TResult> operation, IChannelSourceHandle channelSource, ICoreSessionHandle session, CancellationToken cancellationToken)

Parameters

operation IWriteOperation<TResult>

The write operation.

channelSource IChannelSourceHandle

The channel source.

session ICoreSessionHandle

The session.

cancellationToken CancellationToken

The cancellation token.

Returns

TResult

The result of the operation.

Type Parameters

TResult

The type of the result.