IChannelCommandTResult 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 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
)
Function Command(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 TResult
abstract Command :
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 -> '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:
TResult
The result of the Command protocol.
See Also