Beispiel #1
0
        public IActionResult DeleteCity(int id, bool includePointsOfInterest = true)
        {
            var cityToDelete = _repository.GetCity(id, includePointsOfInterest);

            if (cityToDelete == null)
            {
                return(NotFound());
            }

            _repository.DeleteCity(cityToDelete);
            return(Ok(cityToDelete));
        }
        public ActionResult UpdateCity(int id)
        {
            CityModel currentCity = citiesRepository.GetById(id);

            if (currentCity is null)
            {
                return(NotFound());
            }

            citiesRepository.DeleteCity(id);

            return(NoContent());
        }
Beispiel #3
0
 public IActionResult Delete(string cityName)
 {
     _citiesRepository.DeleteCity(cityName);
     return(Ok());
 }