Table of Contents

Method Execute

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

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.