public IActionResult Post([FromForm] TouristSpotModel touristSpotModel) { IActionResult result; if (touristSpotModel.HasErrors()) { result = BadRequest(new ErrorModel(touristSpotModel.Errors())); } else { var touristSpot = TouristSpotLogic.Create(touristSpotModel.ToEntity()); result = Created("GetTouristSpot", new TouristSpotBasicInfoModel(touristSpot)); } return(result); }
public void IsValidReturnsTrueIfTouristSpotIsValid() { Assert.IsFalse(TouristSpotModel.HasErrors()); }