Click or drag to resize

IChannelCommandTResult Method (DatabaseNamespace, BsonDocument, IElementNameValidator, FuncCommandResponseHandling, Boolean, IBsonSerializerTResult, MessageEncoderSettings, CancellationToken)

Note: This API is now obsolete.

Executes a Command protocol.

Namespace:  MongoDB.Driver.Core.Bindings
Assembly:  MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.9.0+32b058abcdf2c7e8d9dd3a676d207b31897eee2e
Syntax
[ObsoleteAttribute("Use the newest overload instead.")]
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