public IActionResult PartiallyUpdatePointOfInterest(int cityId, int pointId,
                                                            [FromBody] JsonPatchDocument <PointOfInterestforUpdateDto> patchDoc)
        {
            if (!_cityInfoRepository.CityExists(cityId))
            {
                return(NotFound());
            }

            PointOfInterest pointOfInterestEntity = _cityInfoRepository.GetPointOfInterest(cityId, pointId);

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

            PointOfInterestforUpdateDto pointOfInterestToPatch = _mapper.Map <PointOfInterestforUpdateDto>(pointOfInterestEntity);

            patchDoc.ApplyTo(pointOfInterestToPatch, ModelState);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (pointOfInterestToPatch.Name == pointOfInterestToPatch.Description)
            {
                ModelState.AddModelError(
                    "Description",
                    "The provided description should be different from the name."
                    );
            }

            if (!TryValidateModel(pointOfInterestToPatch))
            {
                return(BadRequest(ModelState));
            }

            _mapper.Map(pointOfInterestToPatch, pointOfInterestEntity);

            _cityInfoRepository.UpdatedPointOfInterestForCity(cityId, pointOfInterestEntity);

            _cityInfoRepository.Save();

            return(NoContent());
        }
        public IActionResult UpdatePointOfInterest(int cityId, int pointId,
                                                   [FromBody] PointOfInterestforUpdateDto pointOfInterestforUpdate)
        {
            if (pointOfInterestforUpdate.Name == pointOfInterestforUpdate.Description)
            {
                ModelState.AddModelError(
                    "Description",
                    "The provided description should be different from the name."
                    );
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }


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

            PointOfInterest pointOfInterestEntity = _cityInfoRepository.GetPointOfInterest(cityId, pointId);

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

            _mapper.Map(pointOfInterestforUpdate, pointOfInterestEntity);

            _cityInfoRepository.UpdatedPointOfInterestForCity(cityId, pointOfInterestEntity);

            _cityInfoRepository.Save();


            return(NoContent());
        }