Exemple #1
0
        public ActionResult <BookingResponse> PostBooking(BookingEntity bookingEntity)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            BookingResponse bookingResponse = bookingServices.BookMovie(bookingEntity);

            if (bookingResponse == null)
            {
                return(BadRequest());
            }

            return(CreatedAtAction("GetBooking", new { bookingEntity.Id }, bookingResponse));
        }