IChannelCommandAsyncTResult Method |
Executes a Command protocol.
Namespace:
MongoDB.Driver.Core.Bindings
Assembly:
MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.22.0+75246110ed1247226fcc7f8eb2c54ffab745693e
Syntax 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
)
Function CommandAsync(Of TResult) (
session As ICoreSession,
readPreference As ReadPreference,
databaseNamespace As DatabaseNamespace,
command As BsonDocument,
commandPayloads As IEnumerable(Of Type1CommandMessageSection),
commandValidator As IElementNameValidator,
additionalOptions As BsonDocument,
postWriteAction As Action(Of IMessageEncoderPostProcessor),
responseHandling As CommandResponseHandling,
resultSerializer As IBsonSerializer(Of TResult),
messageEncoderSettings As MessageEncoderSettings,
cancellationToken As CancellationToken
) As Task(Of TResult)
abstract CommandAsync :
session : ICoreSession *
readPreference : ReadPreference *
databaseNamespace : DatabaseNamespace *
command : BsonDocument *
commandPayloads : IEnumerable<Type1CommandMessageSection> *
commandValidator : IElementNameValidator *
additionalOptions : BsonDocument *
postWriteAction : Action<IMessageEncoderPostProcessor> *
responseHandling : CommandResponseHandling *
resultSerializer : IBsonSerializer<'TResult> *
messageEncoderSettings : MessageEncoderSettings *
cancellationToken : CancellationToken -> Task<'TResult>
Parameters
- session
- Type: MongoDB.Driver.Core.BindingsICoreSession
The session. - readPreference
- Type: MongoDB.DriverReadPreference
The read preference. - databaseNamespace
- Type: MongoDB.DriverDatabaseNamespace
The database namespace. - command
- Type: MongoDB.BsonBsonDocument
The command. - commandPayloads
- Type: System.Collections.GenericIEnumerableType1CommandMessageSection
The command payloads. - commandValidator
- Type: MongoDB.Bson.IOIElementNameValidator
The command validator. - additionalOptions
- Type: MongoDB.BsonBsonDocument
The additional options. - postWriteAction
- Type: SystemActionIMessageEncoderPostProcessor
The post write action. - responseHandling
- Type: MongoDB.Driver.Core.WireProtocolCommandResponseHandling
The response handling. - resultSerializer
- Type: MongoDB.Bson.SerializationIBsonSerializerTResult
The result serializer. - messageEncoderSettings
- Type: MongoDB.Driver.Core.WireProtocol.Messages.EncodersMessageEncoderSettings
The message encoder settings. - cancellationToken
- Type: System.ThreadingCancellationToken
The cancellation token.
Type Parameters
- TResult
- The type of the result.
Return Value
Type:
TaskTResult
A Task whose result is the result of the Command protocol.
See Also