Example #1
0
        static void UiGetIngredientDescriptions(Cocktail cocktail)
        {
            List <Food> ingredients = ingredientController.GetAll();

            for (int i = 0; i < ingredients.Count; i++)
            {
                Console.WriteLine($" {i}. {ingredients[i].Name} : {ingredients[i].FoodType.ToString()}");
            }
            Console.WriteLine("\r\nIngredient:");
            int choice = int.Parse(Console.ReadLine());

            Console.WriteLine("\r\nDescription:");
            string decscription = Console.ReadLine();

            cocktail.IngredientDescription.Add(new Ingredient(ingredients[choice].Name, decscription));

            Console.WriteLine("Do you want more ingredients, type 'Y' ");
            ConsoleKeyInfo key = Console.ReadKey();

            if (key.Key == ConsoleKey.Y)
            {
                UiGetIngredientDescriptions(cocktail);
            }
        }