Exemplo n.º 1
0
        public async Task <IActionResult> DeleteCity(int cityId, int id)
        {
            var cityToDelete = await _repository.GetCityForCountry(id, cityId);

            if (cityToDelete == null)
            {
                return(NotFound());
            }
            _repository.DeleteCityForCountry(cityToDelete);
            if (!await _repository.Save())
            {
                throw new Exception("Failed");
            }
            return(NoContent());
        }