Ejemplo n.º 1
0
 public void Handle(AddOrderLineRequest command)
 {
     using (IUnitOfWork uow = this.CreateUnitOfWork <OrderAggregate>())
     {
         IOrderRepository repository = IoC.Container.Resolve <IOrderRepository>(uow);
         OrderAggregate   order      = repository.GetById(command.OrderId.ToString(), "OrderLines");
         order.AddOrderLineItem(command.ProductId, command.ProductName, command.Quantity, command.Price);
         repository.Update(order);
         uow.Commit();
         order.PublishEvents();
     }
 }