Example #1
0
        public async Task <ActionResult <ResponseBase <bool> > > AddBookingAsync()
        {
            if (!ModelState.IsValid)
            {
                throw new HttpStatusCodeResponseException(HttpStatusCode.BadRequest);
            }

            bool result = await _bookingProvider.AddBookingAsync();

            return(new ResponseBase <bool>(result));
        }
        public async Task <IActionResult> AddBooking([FromBody] AddBookingFilter filter)
        {
            var result = await _bookingProvider.AddBookingAsync(filter.RoomId, filter.StartDate, filter.EndDate);

            return(Ok(_mapper.Map <BookingDto>(result)));
        }