IChannelCommandAsyncTResult Method |
Executes a Command protocol.
Namespace: MongoDB.Driver.Core.BindingsAssembly: MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.3.0
Syntax Task<TResult> CommandAsync<TResult>(
DatabaseNamespace databaseNamespace,
BsonDocument command,
IElementNameValidator commandValidator,
Func<CommandResponseHandling> responseHandling,
bool slaveOk,
IBsonSerializer<TResult> resultSerializer,
MessageEncoderSettings messageEncoderSettings,
CancellationToken cancellationToken
)
Function CommandAsync(Of TResult) (
databaseNamespace As DatabaseNamespace,
command As BsonDocument,
commandValidator As IElementNameValidator,
responseHandling As Func(Of CommandResponseHandling),
slaveOk As Boolean,
resultSerializer As IBsonSerializer(Of TResult),
messageEncoderSettings As MessageEncoderSettings,
cancellationToken As CancellationToken
) As Task(Of TResult)
abstract CommandAsync :
databaseNamespace : DatabaseNamespace *
command : BsonDocument *
commandValidator : IElementNameValidator *
responseHandling : Func<CommandResponseHandling> *
slaveOk : bool *
resultSerializer : IBsonSerializer<'TResult> *
messageEncoderSettings : MessageEncoderSettings *
cancellationToken : CancellationToken -> Task<'TResult>
Parameters
- databaseNamespace
- Type: MongoDB.DriverDatabaseNamespace
The database namespace. - command
- Type: MongoDB.BsonBsonDocument
The command. - commandValidator
- Type: MongoDB.Bson.IOIElementNameValidator
The command validator. - responseHandling
- Type: SystemFuncCommandResponseHandling
The response handling. - slaveOk
- Type: SystemBoolean
if set to true sets the SlaveOk bit to true in the command message sent to the server. - 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:
TaskTResultA Task whose result is the result of the Command protocol.
See Also