public void Put(string id, [FromBody] Item item) { var itemAdded = new ItemAdded { AggregateId = id, ItemName = item.ItemName, Quantity = item.Quantity }; _repository.StoreEvent<Order>(HardCodedTenantIdForPoc, itemAdded); }
private void Process(ItemAdded itemAdded) { var item = Items.Find(x => x.ItemName == itemAdded.ItemName); if (item != null) { item.Quantity += itemAdded.Quantity; } else { Items.Add(new Item { ItemName = itemAdded.ItemName, Quantity = itemAdded.Quantity }); } }