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