Click or drag to resize
IChannelCommandTResult Method
Executes a Command protocol.

Namespace: MongoDB.Driver.Core.Bindings
Assembly: MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.4.1
Syntax
TResult Command<TResult>(
	DatabaseNamespace databaseNamespace,
	BsonDocument command,
	IElementNameValidator commandValidator,
	Func<CommandResponseHandling> responseHandling,
	bool slaveOk,
	IBsonSerializer<TResult> resultSerializer,
	MessageEncoderSettings messageEncoderSettings,
	CancellationToken cancellationToken
)

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: TResult
The result of the Command protocol.
See Also