public JsonResult GetStatesByCountry(int country_id) { List <object> states = new List <object>(); StatesServices stateService = new StatesServices(); foreach (var state in stateService.GetStatesForDropDownList(country_id)) { states.Add( new { optionValue = state.Key, optionDisplay = state.Value }); } return(Json(states)); }
public StatesController(StatesServices _stateService) { this._stateService = _stateService; }
public StatesController() { _stateService = new StatesServices(); }