public IActionResult InsertPointOfInterest(int cityId, [FromBody] PointOfInterestForCreatingDto pointOfInterestForCreatingDTO)
        {
            if (pointOfInterestForCreatingDTO.Name == pointOfInterestForCreatingDTO.Description)
            {
                ModelState.AddModelError("Description",
                                         "description should be different from name");
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!_cityInfoRepository.CityExists(cityId))
            {
                return(NotFound());
            }


            var pointOfInterestDto = _mapper.Map <Entities.PointOfInterest>(pointOfInterestForCreatingDTO);

            _cityInfoRepository.InsertPointOfInterest(cityId, pointOfInterestDto);

            _cityInfoRepository.Save();

            var cretedPointOfInterestToReturn = _mapper.Map <Models.PointOfInterestDto>(pointOfInterestDto);

            return(CreatedAtRoute("GetPointsOfInterests", new { cityId, id = cretedPointOfInterestToReturn.Id }, cretedPointOfInterestToReturn));
        }
        public IActionResult UpdatePointOfInterest(int cityId, int id, [FromBody] PointOfInterestForCreatingDto pointOfInterestForCreatingDTO)
        {
            if (!_cityInfoRepository.CityExists(cityId))
            {
                return(NotFound());
            }
            var pointOfInterestEntity = _cityInfoRepository.GetPointOfInterestForCity(cityId, id);

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

            _mapper.Map(pointOfInterestForCreatingDTO, pointOfInterestEntity);

            _cityInfoRepository.UpdatePointOfInterest(cityId, pointOfInterestEntity);

            _cityInfoRepository.Save();

            return(NoContent());
        }