Method RunCommand
RunCommand<TResult>(Command<TResult>, ReadPreference, CancellationToken)
Runs a command.
TResult RunCommand<TResult>(Command<TResult> command, ReadPreference readPreference = null, CancellationToken cancellationToken = default)
Parameters
commandCommand<TResult>The command.
readPreferenceReadPreferenceThe read preference.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- TResult
The result of the command.
Type Parameters
TResultThe 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
sessionIClientSessionHandleThe session.
commandCommand<TResult>The command.
readPreferenceReadPreferenceThe read preference.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- TResult
The result of the command.
Type Parameters
TResultThe result type of the command.