// // GET: /Search/ public ActionResult Index(AdvancedAdSearchModel model) { ViewBag.Categories = _categoryServices.GetAllCategoriesOfAGroup(model.CategorySelectedId) .Select(x => new SelectListItem { Text = x.Label, Value = x.Id.ToString() }); // Equivalent to Search/Search? if (model.CategorySelectedId.HasValue) { AdSearchResultModel result = _searchServices.SearchAds(model); return(View(result)); } // Equivalent to Search/QuickSearch? (when no categories) else { AdHomeSearchResultModel result = _searchServices.QuickSearch(model); return(View("QuickSearch", result)); } }