/// <summary> /// Represents the index listing of cities. /// </summary> /// <returns></returns> public IActionResult Index() { // Get all of the cities var cities = dal.GetCities(); // Return the Index view return(View(cities)); }
/// <summary> /// Represents a search result. /// </summary> /// <param name="searchModel"></param> /// <returns></returns> public IActionResult Results(CitySearchModel searchModel) { var cities = cityDAL.GetCities(searchModel.CountryCode, searchModel.District); // Update the search model with the cities returned searchModel.Results = cities; // Display search results return(View(searchModel)); }