Esempio n. 1
0
        public async Task <IActionResult> DeleteCity(int cityId, int placeId)
        {
            var placeToDelete = await _repository.GetPlaceForCity(cityId, placeId);

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