本文整理汇总了C#中Order.Dispatch方法的典型用法代码示例。如果您正苦于以下问题:C# Order.Dispatch方法的具体用法?C# Order.Dispatch怎么用?C# Order.Dispatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order.Dispatch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Dispatch
public ActionResult Dispatch(Order order)
{
if (order.IsCreated)
{
order.Dispatch(userService.CurrentUser);
}
return this.RedirectToAction<OrderController>(c => c.Item(order.Id));
}
示例2: Dispatch_should_raise_OrderDispatched_event
public void Dispatch_should_raise_OrderDispatched_event()
{
OrderDispatched orderDispatched = null;
using (DomainEvent.TestWith(e => orderDispatched = e as OrderDispatched))
{
var order = new Order {OrderStatus = OrderStatus.Created};
order.Dispatch(new User());
orderDispatched.ShouldNotBeNull();
orderDispatched.Order.ShouldBeTheSameAs(order);
}
}
示例3: Dispatch_should_change_status_to_Dispatched
public void Dispatch_should_change_status_to_Dispatched()
{
using (DomainEvent.TurnOff())
{
var order = new Order
{
OrderStatus = OrderStatus.Created
};
var user = new User();
order.Dispatch(user);
order.IsDispatched.ShouldBeTrue();
order.DispatchedDate.Date.ShouldEqual(DateTime.Now.Date);
order.ModifiedBy.ShouldBeTheSameAs(user);
}
}