public async Task <IActionResult> AddTour([FromBody] TourForCreation tour) { if (tour == null) { return(BadRequest()); } return(await AddSpecificTour(tour)); }
public async Task <IActionResult> AddTour([FromBody] TourForCreation tour) { if (tour == null) { return(BadRequest()); } // validation of the DTO happens here return(await AddSpecificTour(tour)); }
public async Task SaveTour(TourForCreation tourLinkDto) { var tour = _mapper.Map <Tour>(tourLinkDto.TourDto); var tourId = await _uow.Tours.Create(tour); if (tourLinkDto.GuideIds.Count > 0) { foreach (var guideId in tourLinkDto.GuideIds) { var tourLink = new TourLink() { TourId = tourId, PlaceId = tourLinkDto.PlaceId, GuideId = guideId }; await _uow.TourLink.Create(tourLink); } } }
public async Task <IActionResult> AddTour([FromBody] TourForCreation tour) { return(await AddSpecificTour(tour)); }
public async Task <IActionResult> CreateTour(TourForCreation tourCreation) { await _tourService.SaveTour(tourCreation); return(Ok()); }
public async Task <IActionResult> AddTourDefault([FromBody] TourForCreation tour) => await AddSpecificTour(tour);