示例#1
0
        public async Task <mdlbooking> Booking([FromServices] IBooking booking, mdlBookingRequest mdl)
        {
            mdlbooking mdlbook = new mdlbooking();

            if (ModelState.IsValid)
            {
                try
                {
                    booking.CustomerId = _customerId;
                    booking.UserId     = _userId;
                    mdlbook.mdlBooking = await booking.BookingAsync(mdl);

                    mdlbook.StatusCode    = 1;
                    mdlbook.StatusMessage = "Success";
                }
                catch (Exception ex)
                {
                    mdlbook.StatusCode    = 0;
                    mdlbook.StatusMessage = ex.Message;
                }
            }
            return(mdlbook);
        }