public IActionResult SearchResults(RoomSearchModel searchModel) { ViewData["Cities"] = formBuilder.GetCities(); ViewData["RoomTypes"] = formBuilder.GetRoomTypes(); ViewData["SearchModel"] = searchModel; IEnumerable <Room> results; if (ModelState.IsValid) { results = roomSearchBuilder.Build(searchModel); } else { results = new List <Room>(); } return(View(results)); }
public IActionResult Index() { ViewData["Cities"] = formBuilder.GetCities(); ViewData["RoomTypes"] = formBuilder.GetRoomTypes(); return(View()); }