Method CommandAsync
CommandAsync<TResult>(ICoreSession, ReadPreference, DatabaseNamespace, BsonDocument, IEnumerable<Type1CommandMessageSection>, IElementNameValidator, BsonDocument, Action<IMessageEncoderPostProcessor>, CommandResponseHandling, IBsonSerializer<TResult>, MessageEncoderSettings, CancellationToken)
Executes a Command protocol.
Task<TResult> CommandAsync<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
- Task<TResult>
A Task whose result is the result of the Command protocol.
Type Parameters
TResult
The type of the result.