public ActionResult GetCitiesByCountryId(string countryId) { if (!Request.IsAuthenticated) { return(RedirectToAction("Login", "Account")); } else { if (!string.IsNullOrWhiteSpace(countryId)) { var repo = new CitiesRepository(); IEnumerable <SelectListItem> cities = repo.GetCities(countryId); return(Json(cities, JsonRequestBehavior.AllowGet)); } else { return(null); } } }
public static List <DTO.City> GetCities() { var cities = CitiesRepository.GetCities(); return(cities); }