Example #1
0
        public IActionResult DeleteNationalPark(int nationalParkId)
        {
            if (!_nationalParkRepository.NationalParkExists(nationalParkId))
            {
                return(BadRequest());
            }

            if (!_nationalParkRepository.DeleteNationalParkFromDatabase(nationalParkId))
            {
                return(StatusCode(500, new { error = "something went wrong while deleting the park" }));
            }

            return(NoContent());
        }