private void Apply(OrderShipped evt) { _state = OrderAggregate.OrderState.Shipped; var reservedOrders = _orderLines.Values.Where(ol => _reservations.Any(r => r.Key == ol.ProductId && r.Value)); foreach (var ol in reservedOrders) { DispatchCommand <ProductAggregate>(new PurchaseReservedProduct(ol.ProductId, ol.Quantity)); } DispatchCommand <DummyNotifier>(new NotifyCustomer(AggregateRepository.CreateGuid())); }
private void Apply(CreateOrderFailed obj) { DispatchCommand <DummyNotifier>(new NotifyAdmin(AggregateRepository.CreateGuid())); }
private void Apply(ProductReservationFailed obj) { DispatchCommand <DummyNotifier>(new NotifyAdmin(AggregateRepository.CreateGuid())); }
private void Apply(OrderDelivered obj) { _state = OrderAggregate.OrderState.Delivered; DispatchCommand <DummyNotifier>(new NotifyAdmin(AggregateRepository.CreateGuid())); }