public IActionResult CreatePointOfIntrest([FromBody] PointsOfCreationForCreationDto pointsOfCreationForCreationDto, int cityId) { if (pointsOfCreationForCreationDto.Name == pointsOfCreationForCreationDto.Description) { ModelState.AddModelError("Description", "The provided description should be different from the Name."); } if (!ModelState.IsValid) { return(BadRequest()); } if (!_repository.CityExists(cityId)) { return(NotFound()); } var finalPointOfIntrest = _mapper.Map <Entities.PointOfIntrest>(pointsOfCreationForCreationDto); _repository.AddPointOfIntrestForCity(cityId, finalPointOfIntrest); _repository.Save(); var createdPointOfIntrestDTO = _mapper.Map <Models.PointOfIntrestDto>(finalPointOfIntrest); return(CreatedAtRoute("GetPointOfIntrest", new { cityId, id = createdPointOfIntrestDTO.Id }, createdPointOfIntrestDTO)); }