• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MessageEncoderSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MessageEncoderSettings的典型用法代码示例。如果您正苦于以下问题:C# MessageEncoderSettings类的具体用法?C# MessageEncoderSettings怎么用?C# MessageEncoderSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MessageEncoderSettings类属于命名空间,在下文中一共展示了MessageEncoderSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BulkDeleteOperationEmulator

 // constructors
 public BulkDeleteOperationEmulator(
     CollectionNamespace collectionNamespace,
     IEnumerable<DeleteRequest> requests,
     MessageEncoderSettings messageEncoderSettings)
     : base(collectionNamespace, requests, messageEncoderSettings)
 {
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:8,代码来源:BulkDeleteOperationEmulator.cs


示例2: Setup

 public void Setup()
 {
     _collectionNamespace = new CollectionNamespace("foo", "bar");
     _fieldName = "a.b";
     _messageEncoderSettings = new MessageEncoderSettings();
     _valueSerializer = new Int32Serializer();
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:7,代码来源:DistinctOperationTests.cs


示例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;
 }
开发者ID:fir3pho3nixx,项目名称:mongo-csharp-driver,代码行数:14,代码来源:MessageJsonEncoderBase.cs


示例4: BulkUpdateOperation

 // constructors
 public BulkUpdateOperation(
     CollectionNamespace collectionNamespace,
     IEnumerable<UpdateRequest> requests,
     MessageEncoderSettings messageEncoderSettings)
     : base(collectionNamespace, requests, messageEncoderSettings)
 {
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:8,代码来源:BulkUpdateOperation.cs


示例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));
 }
开发者ID:mfidemraizer,项目名称:mongo-csharp-driver,代码行数:15,代码来源:MapReduceOperationBase.cs


示例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;
 }
开发者ID:bollinim,项目名称:mongo-csharp-driver,代码行数:9,代码来源:MapReduceOperationBase.cs


示例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");
 }
开发者ID:kay-kim,项目名称:mongo-csharp-driver,代码行数:10,代码来源:UpdateOpcodeOperationEmulator.cs


示例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));
 }
开发者ID:RainsSoft,项目名称:mongo-csharp-driver,代码行数:10,代码来源:UpdateOpcodeOperationEmulator.cs


示例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;
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:10,代码来源:BulkUnmixedWriteOperationEmulatorBase.cs


示例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;
 }
开发者ID:bollinim,项目名称:mongo-csharp-driver,代码行数:10,代码来源:AggregateOperationBase.cs


示例11: DeleteOpcodeOperationEmulator

 // constructors
 public DeleteOpcodeOperationEmulator(
     CollectionNamespace collectionNamespace,
     BsonDocument criteria,
     MessageEncoderSettings messageEncoderSettings)
 {
     _collectionNamespace = Ensure.IsNotNull(collectionNamespace, "collectionNamespace");
     _criteria = Ensure.IsNotNull(criteria, "criteria");
     _messageEncoderSettings = messageEncoderSettings;
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:10,代码来源:DeleteOpcodeOperationEmulator.cs


示例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;
 }
开发者ID:kay-kim,项目名称:mongo-csharp-driver,代码行数:12,代码来源:DeleteWireProtocol.cs


示例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;
 }
开发者ID:rmattos,项目名称:mongo-csharp-driver,代码行数:12,代码来源:UpdateOpcodeOperationEmulator.cs


示例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>();
        }
开发者ID:RavenZZ,项目名称:MDRelation,代码行数:12,代码来源:GroupOperationTests.cs


示例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);
        }
开发者ID:RavenZZ,项目名称:MDRelation,代码行数:13,代码来源:CursorBatchDeserializationHelperTests.cs


示例16: UpdateWireProtocol

 // constructors
 public UpdateWireProtocol(
     CollectionNamespace collectionNamespace,
     MessageEncoderSettings messageEncoderSettings,
     WriteConcern writeConcern,
     BsonDocument query,
     BsonDocument update,
     IElementNameValidator updateValidator,
     bool isMulti,
     bool isUpsert)
     : base(collectionNamespace, messageEncoderSettings, writeConcern)
 {
     _updateValidator = Ensure.IsNotNull(updateValidator, nameof(updateValidator));
     _query = Ensure.IsNotNull(query, nameof(query));
     _update = Ensure.IsNotNull(update, nameof(update));
     _isMulti = isMulti;
     _isUpsert = isUpsert;
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:18,代码来源:UpdateWireProtocol.cs


示例17: constructor_should_initialize_instance

        public void constructor_should_initialize_instance()
        {
            var channelSource = Substitute.For<IChannelSource>();
            var databaseNamespace = new DatabaseNamespace("test");
            var collectionNamespace = new CollectionNamespace(databaseNamespace, "test");
            var query = new BsonDocument("x", 1);
            var firstBatch = new BsonDocument[] { new BsonDocument("y", 2) };
            var cursorId = 1L;
            var batchSize = 2;
            var limit = 3;
            var serializer = BsonDocumentSerializer.Instance;
            var messageEncoderSettings = new MessageEncoderSettings();
            var maxTime = TimeSpan.FromSeconds(1);

            var result = new AsyncCursor<BsonDocument>(
                channelSource,
                collectionNamespace,
                query,
                firstBatch,
                cursorId,
                batchSize,
                limit,
                serializer,
                messageEncoderSettings,
                maxTime);

            var reflector = new Reflector(result);
            reflector.BatchSize.Should().Be(batchSize);
            reflector.ChannelSource.Should().Be(channelSource);
            reflector.CollectionNamespace.Should().Be(collectionNamespace);
            reflector.Count.Should().Be(firstBatch.Length);
            reflector.CurrentBatch.Should().BeNull();
            reflector.CursorId.Should().Be(cursorId);
            reflector.Disposed.Should().BeFalse();
            reflector.FirstBatch.Should().Equal(firstBatch);
            reflector.Limit.Should().Be(limit);
            reflector.MaxTime.Should().Be(maxTime);
            reflector.MessageEncoderSettings.Should().BeEquivalentTo(messageEncoderSettings);
            reflector.Query.Should().Be(query);
            reflector.Serializer.Should().Be(serializer);
        }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:41,代码来源:AsyncCursorTests.cs


示例18: constructor_with_key_should_initialize_subject

        public void constructor_with_key_should_initialize_subject()
        {
            var collectionNamespace = new CollectionNamespace("databaseName", "collectionName");
            var key = new BsonDocument("key", 1);
            var initial = new BsonDocument("x", 1);
            var reduceFunction = new BsonJavaScript("reduceFunction");
            var filter = new BsonDocument("y", 1);
            var messageEncoderSettings = new MessageEncoderSettings();

            var subject = new GroupOperation<BsonDocument>(collectionNamespace, key, initial, reduceFunction, filter, messageEncoderSettings);

            subject.CollectionNamespace.Should().Be(collectionNamespace);
            subject.Filter.Should().Be(filter);
            subject.FinalizeFunction.Should().BeNull();
            subject.Initial.Should().Be(initial);
            subject.Key.Should().Be(key);
            subject.KeyFunction.Should().BeNull();
            subject.MaxTime.Should().Be(default(TimeSpan?));
            Assert.Equal(messageEncoderSettings, subject.MessageEncoderSettings);
            subject.ReduceFunction.Should().Be(reduceFunction);
            subject.ResultSerializer.Should().BeNull();
        }
开发者ID:RavenZZ,项目名称:MDRelation,代码行数:22,代码来源:GroupOperationTests.cs


示例19: KillCursorsMessageJsonEncoder

 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="KillCursorsMessageJsonEncoder"/> class.
 /// </summary>
 /// <param name="textReader">The text reader.</param>
 /// <param name="textWriter">The text writer.</param>
 /// <param name="encoderSettings">The encoder settings.</param>
 public KillCursorsMessageJsonEncoder(TextReader textReader, TextWriter textWriter, MessageEncoderSettings encoderSettings)
     : base(textReader, textWriter, encoderSettings)
 {
 }
开发者ID:kay-kim,项目名称:mongo-csharp-driver,代码行数:11,代码来源:KillCursorsMessageJsonEncoder.cs


示例20: TestFixtureSetUp

 public void TestFixtureSetUp()
 {
     _collectionNamespace = CoreTestConfiguration.GetCollectionNamespaceForTestFixture();
     _messageEncoderSettings = CoreTestConfiguration.MessageEncoderSettings;
 }
开发者ID:narutoswj,项目名称:mongo-csharp-driver,代码行数:5,代码来源:CreateCollectionOperationTests.cs



注:本文中的MessageEncoderSettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MessageEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# MessageEncoder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap