本文整理汇总了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);
}
示例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
}
示例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
}
示例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
}
示例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);
}