Table of Contents

Method ExecuteAsync

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

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.