本文整理汇总了C#中SendOptions.DoNotDeliverBefore方法的典型用法代码示例。如果您正苦于以下问题:C# SendOptions.DoNotDeliverBefore方法的具体用法?C# SendOptions.DoNotDeliverBefore怎么用?C# SendOptions.DoNotDeliverBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SendOptions
的用法示例。
在下文中一共展示了SendOptions.DoNotDeliverBefore方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDeliveryDate_Should_Return_The_Configured_Delivery_Date
public void GetDeliveryDate_Should_Return_The_Configured_Delivery_Date()
{
var options = new SendOptions();
DateTimeOffset deliveryDate = new DateTime(2012, 12, 12, 12, 12, 12);
options.DoNotDeliverBefore(deliveryDate);
Assert.AreEqual(deliveryDate, options.GetDeliveryDate());
}
示例2: SendDelayedMessage
async Task SendDelayedMessage(IEndpointInstance endpoint, IMessageHandlerContext handlerContext)
{
#region delayed-delivery-datetime
SendOptions options = new SendOptions();
options.DoNotDeliverBefore(new DateTime(2016, 12, 25));
await handlerContext.Send(new MessageToBeSentLater(), options);
// OR
await endpoint.Send(new MessageToBeSentLater(), options);
#endregion
}
示例3: SendDelayedMessage
public async Task SendDelayedMessage()
{
IBusSession busSession = null;
IMessageHandlerContext handlerContext = null;
#region delayed-delivery-datetime
SendOptions options = new SendOptions();
options.DoNotDeliverBefore(new DateTime(2016, 12, 25));
await handlerContext.Send(new MessageToBeSentLater(), options);
// OR
await busSession.Send(new MessageToBeSentLater(), options);
#endregion
}
示例4: DelayedDelivery
async Task DelayedDelivery(IMessageHandlerContext handlerContext, object message)
{
#region 5to6delayed-delivery
SendOptions sendOptions = new SendOptions();
sendOptions.DelayDeliveryWith(TimeSpan.FromMinutes(30));
//OR
sendOptions.DoNotDeliverBefore(new DateTime(2016, 12, 25));
await handlerContext.Send(message, sendOptions);
#endregion
}