Esempio n. 1
0
        public async Task <IActionResult> DeleteCountry(int id)
        {
            var countryToDelete = await _repository.GetCountry(id);

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