Method RunCommand
RunCommand<TResult>(Command<TResult>, ReadPreference, CancellationToken)
Runs a command.
TResult RunCommand<TResult>(Command<TResult> command, ReadPreference readPreference = null, CancellationToken cancellationToken = default)
Parameters
command
Command<TResult>The command.
readPreference
ReadPreferenceThe read preference.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- TResult
The result of the command.
Type Parameters
TResult
The result type of the command.
RunCommand<TResult>(IClientSessionHandle, Command<TResult>, ReadPreference, CancellationToken)
Runs a command.
TResult RunCommand<TResult>(IClientSessionHandle session, Command<TResult> command, ReadPreference readPreference = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSessionHandleThe session.
command
Command<TResult>The command.
readPreference
ReadPreferenceThe read preference.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- TResult
The result of the command.
Type Parameters
TResult
The result type of the command.