コード例 #1
0
        public async Task AddOrder(Badge badge)
        {
            var Order    = new Order();
            var OrderDtl = new OrderDetails();
            var sugar    = new Sugar(drinkOrder.Quantity);

            Order.Badge = badge;
            await order.AddOrder(Order);

            OrderDtl.Drink = await drinks.GetDrinkById(drinkOrder.DrinkId);

            OrderDtl.Mug = drinkOrder.Mug;
            sugar.Add(OrderDtl);

            await orderDetail.Add(OrderDtl, Order.Badge.Id);
        }
コード例 #2
0
 /// <summary>
 /// Adds a sugar to the sugar cache.
 /// </summary>
 /// <param name="sugar">The given sugar.</param>
 public void Add(Sugar sugar) => Sugar.Add(sugar);