Exemple #1
0
        public void AddIngredient(ToppingEnum ingredientEnum)
        {
            var ingredient = Toppings.GetToppingByEnum(ingredientEnum);

            if (ingredient != null)
            {
                Ingredients.Add(ingredient);
            }
            CalculatePrice();
        }
Exemple #2
0
        public bool AddIngredient(int id)
        {
            var topping = Toppings.GetToppingById(id);

            if (topping == null)
            {
                return(false);
            }
            Ingredients.Add(topping);
            CalculatePrice();
            return(true);
        }