Ejemplo n.º 1
0
        //View existing content by title
        private void DisplayAllMenuItemsByName()
        {
            Console.Clear();
            //Prompt user to give name of meal
            Console.WriteLine("Enter the name of the meal:");
            // Get users input
            string mealName = Console.ReadLine();

            //Find the meal by that name
            MenuItems menuItems = _menuItemsRepo.GetItemByMealName(mealName);

            //Display content if is not null
            if (menuItems != null)
            {
                Console.WriteLine($"Name: {menuItems.MealName}\n" +
                                  $"Description: {menuItems.ItemDescription}\n" +
                                  $"Price: {menuItems.Price}\n" +
                                  $"Meal Number: {menuItems.MealNumber}\n" +
                                  $"Ingredients: {menuItems.Ingredients}");
            }
            else
            {
                Console.WriteLine("No content by that name.");
            }
        }