//view a single menu item private void ViewSingleMenuItem() { Console.Clear(); Console.WriteLine("Please enter the meal name or number:"); string input = Console.ReadLine(); int singleNum; bool isItNumber = Int32.TryParse(input, out singleNum); if (isItNumber == true) { Cafe item = _menuRepo.GetItemsByNumber(singleNum); if (item != null) { string writeIngredients = null; foreach (string ingredients in item.Ingredients) { writeIngredients = ingredients; } Console.WriteLine($"Meal Number: {item.MealNumber}\n" + $"Meal Name: {item.MealName}\n" + $"Description: {item.Description}\n" + $"Ingredients: {writeIngredients}\n" + $"Price: {item.Price}\n" + $"\n"); } else { Console.WriteLine("There was no meal attributed to that number. \n"); } } else { Cafe item = _menuRepo.GetItemsByName(input); if (item != null) { string writeIngredients = null; foreach (string ingredients in item.Ingredients) { writeIngredients = ingredients; } Console.WriteLine($"Meal Number: {item.MealNumber}\n" + $"Meal Name: {item.MealName}\n" + $"Description: {item.Description}\n" + $"Ingredients: {writeIngredients}\n" + $"Price: {item.Price}\n" + $"\n"); } else { Console.WriteLine("There was no meal attributed to that number. \n"); } } }