Exemplo n.º 1
0
        public void AddOrderIngredients(List <orderingredient> ingredients, int orderId)
        {
            try
            {
                foreach (var i in ingredients)
                {
                    if (i.quantity < 1)
                    {
                        continue;
                    }

                    orderingredient orderIngredient = new orderingredient()
                    {
                        orderid      = orderId,
                        ingredientid = i.ingredientid,
                        quantity     = i.quantity
                    };

                    repository.AddOrderIngredient(orderIngredient);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }