public ActionResult Index(string search) { if (!String.IsNullOrEmpty(search)) { return(View(applicationServices.GetRestaurantBySearch(search))); } if (TempData["restaurants"] == null) { return(View(applicationServices.GetAllRestaurants())); } return(View(TempData["restaurants"])); }
public void PrintRestaurantSearch(string search) { List <Restaurant> restaurants = _pzServices.GetRestaurantBySearch(search); if (restaurants.Count == 0) { Console.WriteLine("Search returned no values."); } else { Print(restaurants); } }