本文整理汇总了C#中MessageEncoderSettings类的典型用法代码示例。如果您正苦于以下问题:C# MessageEncoderSettings类的具体用法?C# MessageEncoderSettings怎么用?C# MessageEncoderSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageEncoderSettings类属于命名空间,在下文中一共展示了MessageEncoderSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BulkDeleteOperationEmulator
// constructors
public BulkDeleteOperationEmulator(
CollectionNamespace collectionNamespace,
IEnumerable<DeleteRequest> requests,
MessageEncoderSettings messageEncoderSettings)
: base(collectionNamespace, requests, messageEncoderSettings)
{
}
示例2: Setup
public void Setup()
{
_collectionNamespace = new CollectionNamespace("foo", "bar");
_fieldName = "a.b";
_messageEncoderSettings = new MessageEncoderSettings();
_valueSerializer = new Int32Serializer();
}
示例3: MessageJsonEncoderBase
// constructor
/// <summary>
/// Initializes a new instance of the <see cref="MessageJsonEncoderBase"/> class.
/// </summary>
/// <param name="textReader">The text reader.</param>
/// <param name="textWriter">The text writer.</param>
/// <param name="encoderSettings">The encoder settings.</param>
protected MessageJsonEncoderBase(TextReader textReader, TextWriter textWriter, MessageEncoderSettings encoderSettings)
{
Ensure.That(textReader != null || textWriter != null, "textReader and textWriter cannot both be null.");
_textReader = textReader;
_textWriter = textWriter;
_encoderSettings = encoderSettings;
}
示例4: BulkUpdateOperation
// constructors
public BulkUpdateOperation(
CollectionNamespace collectionNamespace,
IEnumerable<UpdateRequest> requests,
MessageEncoderSettings messageEncoderSettings)
: base(collectionNamespace, requests, messageEncoderSettings)
{
}
示例5: MapReduceOperationBase
// constructors
/// <summary>
/// Initializes a new instance of the <see cref="MapReduceOperationBase"/> class.
/// </summary>
/// <param name="collectionNamespace">The collection namespace.</param>
/// <param name="mapFunction">The map function.</param>
/// <param name="reduceFunction">The reduce function.</param>
/// <param name="messageEncoderSettings">The message encoder settings.</param>
protected MapReduceOperationBase(CollectionNamespace collectionNamespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
_mapFunction = Ensure.IsNotNull(mapFunction, nameof(mapFunction));
_reduceFunction = Ensure.IsNotNull(reduceFunction, nameof(reduceFunction));
_messageEncoderSettings = Ensure.IsNotNull(messageEncoderSettings, nameof(messageEncoderSettings));
}
示例6: MapReduceOperationBase
// constructors
protected MapReduceOperationBase(CollectionNamespace collectionNamespace, BsonJavaScript mapFunction, BsonJavaScript reduceFunction, BsonDocument query, MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
_mapFunction = Ensure.IsNotNull(mapFunction, "mapFunction");
_reduceFunction = Ensure.IsNotNull(reduceFunction, "reduceFunction");
_query = query;
_messageEncoderSettings = messageEncoderSettings;
}
示例7: UpdateOpcodeOperationEmulator
// constructors
public UpdateOpcodeOperationEmulator(
CollectionNamespace collectionNamespace,
UpdateRequest request,
MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
_request = Ensure.IsNotNull(request, "request");
_messageEncoderSettings = Ensure.IsNotNull(messageEncoderSettings, "messageEncoderSettings");
}
示例8: UpdateOpcodeOperationEmulator
// constructors
public UpdateOpcodeOperationEmulator(
CollectionNamespace collectionNamespace,
UpdateRequest request,
MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
_request = Ensure.IsNotNull(request, nameof(request));
_messageEncoderSettings = Ensure.IsNotNull(messageEncoderSettings, nameof(messageEncoderSettings));
}
示例9: BulkUnmixedWriteOperationEmulatorBase
// constructors
protected BulkUnmixedWriteOperationEmulatorBase(
CollectionNamespace collectionNamespace,
IEnumerable<WriteRequest> requests,
MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, nameof(collectionNamespace));
_requests = Ensure.IsNotNull(requests, nameof(requests));
_messageEncoderSettings = messageEncoderSettings;
}
示例10: AggregateOperationBase
// constructors
protected AggregateOperationBase(
CollectionNamespace collectionNamespace,
IEnumerable<BsonDocument> pipeline,
MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
_pipeline = Ensure.IsNotNull(pipeline, "pipeline").ToList();
_messageEncoderSettings = messageEncoderSettings;
}
示例11: DeleteOpcodeOperationEmulator
// constructors
public DeleteOpcodeOperationEmulator(
CollectionNamespace collectionNamespace,
BsonDocument criteria,
MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
_criteria = Ensure.IsNotNull(criteria, "criteria");
_messageEncoderSettings = messageEncoderSettings;
}
示例12: DeleteWireProtocol
// constructors
public DeleteWireProtocol(
CollectionNamespace collectionNamespace,
BsonDocument query,
bool isMulti,
MessageEncoderSettings messageEncoderSettings,
WriteConcern writeConcern)
: base(collectionNamespace, messageEncoderSettings, writeConcern)
{
_query = Ensure.IsNotNull(query, "query");
_isMulti = isMulti;
}
示例13: UpdateOpcodeOperationEmulator
// constructors
public UpdateOpcodeOperationEmulator(
CollectionNamespace collectionNamespace,
BsonDocument query,
BsonDocument update,
MessageEncoderSettings messageEncoderSettings)
{
_collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
_criteria = Ensure.IsNotNull(query, "criteria");
_update = Ensure.IsNotNull(update, "update");
_messageEncoderSettings = messageEncoderSettings;
}
示例14: constructor_with_key_should_throw_when_initial_is_null
public void constructor_with_key_should_throw_when_initial_is_null()
{
var collectionNamespace = new CollectionNamespace("databaseName", "collectionName");
var key = new BsonDocument("key", 1);
var reduceFunction = new BsonJavaScript("reduceFunction");
var filter = new BsonDocument("y", 1);
var messageEncoderSettings = new MessageEncoderSettings();
Action action = () => new GroupOperation<BsonDocument>(collectionNamespace, key, null, reduceFunction, filter, messageEncoderSettings);
action.ShouldThrow<ArgumentNullException>();
}
示例15: DeserializeBatch_should_return_expected_result_when_batch_is_empty
public void DeserializeBatch_should_return_expected_result_when_batch_is_empty()
{
var document = BsonDocument.Parse("{ batch : [ ] }");
var bson = document.ToBson();
var rawDocument = new RawBsonDocument(bson);
var batch = (RawBsonArray)rawDocument["batch"];
var documentSerializer = BsonDocumentSerializer.Instance;
var messageEncoderSettings = new MessageEncoderSettings();
var result = CursorBatchDeserializationHelper.DeserializeBatch<BsonDocument>(batch, documentSerializer, messageEncoderSettings);
result.Count.Should().Be(0);
}