Beispiel #1
0
        public async Task <IActionResult> ListCities(int state)
        {
            try
            {
                var cities = await _localization.GetCities(state);

                if (cities == null)
                {
                    return(BadRequest("There was an error to load the cities."));
                }

                return(Json(cities));
            }

            catch (Exception ex)
            {
                return(BadRequest("There was an internal error"));
            }
        }