public void Handle(QuantityTaken e) { using (IDocumentSession session = _store.OpenSession()) { var item = session.Load <SerialNumber>(e.SerialNumberId); item.Quantity -= e.Quantity; session.Store(item); session.SaveChanges(); } }
private void Handle(QuantityTaken @event) { this.Quantity = new ValueObjects.Quantity(this.Quantity.Total - @event.Quantity); }