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));
public IMessageHandling Handle(AddItem command) => base.FromNewStreamIfNotExists(command.InventoryId, aggregate => aggregate.Handle(command));