Пример #1
0
        public async Task <IActionResult> PostAsync(BookingCreateModel value)
        {
            try
            {
                await bookingService.AddBookingAsync(value);

                return(Ok());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public async Task <IActionResult> AddBooking(Guid hotelId, BookingForAddOrUpdateDto bookingToAdd)
        {
            var booking = await _bookingService.AddBookingAsync(hotelId, bookingToAdd);

            return(CreatedAtAction(nameof(GetBookingById), new { hotelId = booking.HotelId, id = booking.Id }, booking));
        }