Exemplo n.º 1
0
 public static Inventory Handle(this Inventory s, AddItem command)
 => s.ItemsQuantityById.ContainsKey(command.ItemId)
                 ? s.Update(new ItemsAdded(command.ItemId, command.Quantity))
                 : s.Update(new NewCollectionOfItems(command.ItemId, command.Quantity));
Exemplo n.º 2
0
 public IMessageHandling Handle(AddItem command)
 => base.FromNewStreamIfNotExists(command.InventoryId, aggregate => aggregate.Handle(command));