Exemple #1
0
        private void AddItemToMenu()
        {
            Console.Clear();
            int      itemCount   = 0;
            MenuItem newMenuItem = GetValuesForMenuItemObject();

            _repo.AddMenuItemToRepo(newMenuItem);
            if (_repo.ToString().Count() > itemCount)
            {
                Console.Write($"Added #: {newMenuItem.MealNumber}" +
                              $"\nMeal Name: {newMenuItem.Name}" +
                              $"\nDescription: {newMenuItem.Description}" +
                              $"\nIngredients: ");
                foreach (string ingredient in newMenuItem.Ingredients)
                {
                    Console.Write($" {ingredient}");
                }
                Console.Write($"\nPrice: {newMenuItem.Price}\n");

                Console.Write("Press and key to return to the menu");
                Menu();
            }
            else
            {
                Console.WriteLine("There are no items in the menu!");
                Menu();
            }
        }