当前位置: 首页>>代码示例>>C#>>正文


C# SendOptions.SetCorrelationId方法代码示例

本文整理汇总了C#中SendOptions.SetCorrelationId方法的典型用法代码示例。如果您正苦于以下问题:C# SendOptions.SetCorrelationId方法的具体用法?C# SendOptions.SetCorrelationId怎么用?C# SendOptions.SetCorrelationId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SendOptions的用法示例。


在下文中一共展示了SendOptions.SetCorrelationId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendOptions_GetCorrelationId_Should_Return_Configured_CorrelationId

        public void SendOptions_GetCorrelationId_Should_Return_Configured_CorrelationId()
        {
            const string expectedCorrelationId = "custom correlation id";
            var options = new SendOptions();
            options.SetCorrelationId(expectedCorrelationId);

            var correlationId = options.GetCorrelationId();

            Assert.AreEqual(expectedCorrelationId, correlationId);
        }
开发者ID:Particular,项目名称:NServiceBus,代码行数:10,代码来源:CorrelationContextExtensionsTests.cs

示例2: Correlation

        async Task Correlation(IPipelineContext context)
        {
            #region custom-correlationid
            SendOptions options = new SendOptions();

            options.SetCorrelationId("My custom correlation id");

            await context.Send(new MyRequest(),options);

            #endregion
        }
开发者ID:odelljl,项目名称:docs.particular.net,代码行数:11,代码来源:Usage.cs

示例3: Correlation

        public async Task Correlation()
        {
            IBusContext busContext = null;

            #region custom-correlationid
            SendOptions options = new SendOptions();

            options.SetCorrelationId("My custom correlation id");

            await busContext.Send(new MyRequest(),options);

            #endregion
        }
开发者ID:cdnico,项目名称:docs.particular.net,代码行数:13,代码来源:Usage.cs

示例4: Usage

        public Usage()
        {
            IBus bus = null;

            #region custom-correlationid
            SendOptions options = new SendOptions();

            options.SetCorrelationId("My custom correlation id");

            bus.Send(new MyRequest(),options);

            #endregion
        }
开发者ID:ryanrdl,项目名称:docs.particular.net,代码行数:13,代码来源:Usage.cs

示例5: SendCommand

    static async void SendCommand(IBus bus)
    {
        Guid commandId = Guid.NewGuid();

        SendOptions sendOptions = new SendOptions();
        sendOptions.SetCorrelationId(commandId.ToString());
        MyCommand message = new MyCommand();
        var response =  await bus.Request<CommandStatus>(new MyCommand
        {
            CommandId = commandId,
            EncryptedString = "Some sensitive information"
        }, sendOptions);
        Console.WriteLine("Callback received with response:" + response);
        Console.WriteLine("Command sent id: " + commandId);

    }
开发者ID:RichieYang,项目名称:docs.particular.net,代码行数:16,代码来源:CommandSender.cs


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