Ejemplo n.º 1
0
        public async Task <Booking> AddLodgmentBookingAsync(int id, BookingConfirmationModel bookingConfirmationModel)
        {
            var lodgment = await repository.GetLodgmentByIdAsync(id);

            if (lodgment == null)
            {
                throw new ArgumentException("The lodgment is out of capacity");
            }

            var booking = await bookingsService.AddBookingAtLodgmentAsync(lodgment, bookingConfirmationModel);

            return(booking);
        }