Exemple #1
0
 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();
     }
 }
Exemple #2
0
 private void Handle(QuantityTaken @event)
 {
     this.Quantity = new ValueObjects.Quantity(this.Quantity.Total - @event.Quantity);
 }