예제 #1
0
 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);
 }
예제 #2
0
파일: Order.cs 프로젝트: ekepes/DemoCode
 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
             });
     }
 }