public async Task <IActionResult> AddTour([FromBody] TourForCreation tour)
 {
     if (tour == null)
     {
         return(BadRequest());
     }
     return(await  AddSpecificTour(tour));
 }
예제 #2
0
        public async Task <IActionResult> AddTour([FromBody] TourForCreation tour)
        {
            if (tour == null)
            {
                return(BadRequest());
            }

            // validation of the DTO happens here

            return(await AddSpecificTour(tour));
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
 public async Task <IActionResult> AddTour([FromBody] TourForCreation tour)
 {
     return(await AddSpecificTour(tour));
 }
예제 #5
0
        public async Task <IActionResult> CreateTour(TourForCreation tourCreation)
        {
            await _tourService.SaveTour(tourCreation);

            return(Ok());
        }
예제 #6
0
 public async Task <IActionResult> AddTourDefault([FromBody] TourForCreation tour) =>
 await AddSpecificTour(tour);