public JsonResult GetByCityID(int id) { List <County> countyList = _countyService.GetListByFilter(a => a.CityID == id); List <CountyDTOForRegistration> countyDTOForRegistrationList = new List <CountyDTOForRegistration>(); foreach (County item in countyList) { countyDTOForRegistrationList.Add(new CountyDTOForRegistration() { ID = item.ID, CountyName = item.CountyName }); } return(Json(countyDTOForRegistrationList, JsonRequestBehavior.AllowGet)); }