public IActionResult Index() { List <string> restaurantList = new List <string>(); foreach (TopRestaurant r in TopRestaurant.GetRestaurants()) { #nullable enable string?favDish = r.FavoriteDish ?? "They're all tasty!"; string?phone = r.Phone; string?website = r.Website ?? "Coming soon."; #nullable disable
public IActionResult Index() { // Creates a list from the array in the model List <TopRestaurant> restList = new List <TopRestaurant>(); foreach (TopRestaurant tr in TopRestaurant.GetRest()) { restList.Add(tr); } return(View(restList)); }