示例#1
0
        public HttpResponseMessage GetCitiesByRegionId(int?regionId)
        {
            if (regionId == null || regionId <= 0)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, new List <CityViewModel>()));
            }

            var cities = _placesService.GetCitiesByRegionId(regionId.Value).OrderBy(c => c.CityName);

            return(Request.CreateResponse(HttpStatusCode.OK, cities));
        }
示例#2
0
        public JsonResult GetCitiesByRegionId(int regionId)
        {
            var regions = _placesService.GetCitiesByRegionId(regionId);

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