Esempio n. 1
0
        public HttpResponseMessage GetCitiesByCountryId(int?countryId)
        {
            if (countryId == null || countryId <= 0)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, new List <CityViewModel>()));
            }

            var cities = _placesService.GetCitiesByCountryId(countryId.Value).OrderBy(c => c.CityName);

            return(Request.CreateResponse(HttpStatusCode.OK, cities));
        }
Esempio n. 2
0
        public JsonResult GetCitiesByCountryId(int countryId)
        {
            var regions = _placesService.GetCitiesByCountryId(countryId);

            return(Json(regions, JsonRequestBehavior.AllowGet));
        }