public ActionResult Index(ReaderViewModel model) { var repo = new GeoRepository(); var repoReader = new ReaderRepository(); model.CountryOptions = repo.GetCountries(); model.StateOptions = (!string.IsNullOrWhiteSpace(model.Country)) ? repo.GetStates(model.Country) : defaultListItem; model.CityOptions = (!string.IsNullOrWhiteSpace(model.State)) ? repo.GetCities(model.State) : defaultListItem; model.CategoryOptions = repo.GetCategory(); model.SubCategoryOptions = defaultListItem; model.information = repoReader.GetRecords(model); return(View(model)); }
// GET: Search public ActionResult Index() { var repo = new GeoRepository(); var model = new ReaderViewModel() { CountryOptions = repo.GetCountries(), StateOptions = defaultListItem, CityOptions = defaultListItem, CategoryOptions = repo.GetCategory(), SubCategoryOptions = defaultListItem }; return(View(model)); }