Exemple #1
0
        public void Remove(Guid Id)
        {
            var pointOfInterest = _PointOfInterestService.Get(Id);

            if (pointOfInterest == null)
            {
                throw new NotFoundException("Não foi encontrado nenhum ponto de interesse para ser removido.");
            }

            _PointOfInterestService.Delete(pointOfInterest);
        }
Exemple #2
0
        public IActionResult DeletePointOfInteres(int cityId, int id)
        {
            var city = _cityService.GetById(cityId, true);

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

            var pointOfInterest = _pointOfInterestservice.GetById(id, true);

            if (pointOfInterest == null)
            {
                return(NotFound());
            }
            _pointOfInterestservice.Delete(id);
            _mailService
            .Send(
                $"Delete point if interest from city {city}",
                $"Delete point if interest from city {city} of point of interest with id {id}"
                );

            return(NoContent());
        }