public void UpdateBuyer(BuyerName buyerName) { Apply(new BuyerEvents.BuyerUpdated { BuyerId = BuyerId, BuyerName = buyerName }); }
public Buyer(BuyerId BuyerId, BuyerName buyerName) { Apply(new BuyerEvents.BuyerCreated { BuyerId = BuyerId, BuyerName = buyerName }); }
protected override void When(object @event) { switch (@event) { case BuyerEvents.BuyerCreated e: BuyerId = new BuyerId(e.BuyerId); BuyerName = new BuyerName(e.BuyerName); break; case BuyerEvents.BuyerUpdated e: BuyerName = new BuyerName(e.BuyerName); break; } }