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
IChannelSourceHandleThe channel source.
readPreference
ReadPreferenceThe read preference.
session
ICoreSessionHandleThe session.
cancellationToken
CancellationTokenThe 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
IChannelSourceHandleThe channel source.
session
ICoreSessionHandleThe session.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<TResult>
A Task whose result is the result of the operation.
Type Parameters
TResult
The type of the result.