Method Command
Command<TResult>(ICoreSession, ReadPreference, DatabaseNamespace, BsonDocument, IEnumerable<Type1CommandMessageSection>, IElementNameValidator, BsonDocument, Action<IMessageEncoderPostProcessor>, CommandResponseHandling, IBsonSerializer<TResult>, MessageEncoderSettings, CancellationToken)
Executes a Command protocol.
TResult Command<TResult>(ICoreSession session, ReadPreference readPreference, DatabaseNamespace databaseNamespace, BsonDocument command, IEnumerable<Type1CommandMessageSection> commandPayloads, IElementNameValidator commandValidator, BsonDocument additionalOptions, Action<IMessageEncoderPostProcessor> postWriteAction, CommandResponseHandling responseHandling, IBsonSerializer<TResult> resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
Parameters
session
ICoreSessionThe session.
readPreference
ReadPreferenceThe read preference.
databaseNamespace
DatabaseNamespaceThe database namespace.
command
BsonDocumentThe command.
commandPayloads
IEnumerable<Type1CommandMessageSection>The command payloads.
commandValidator
IElementNameValidatorThe command validator.
additionalOptions
BsonDocumentThe additional options.
postWriteAction
Action<IMessageEncoderPostProcessor>The post write action.
responseHandling
CommandResponseHandlingThe response handling.
resultSerializer
IBsonSerializer<TResult>The result serializer.
messageEncoderSettings
MessageEncoderSettingsThe message encoder settings.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- TResult
The result of the Command protocol.
Type Parameters
TResult
The type of the result.