public Ticket BookTicket(BookTicketRequest bookTicketRequest)
        {
            Ticket ticket = null;
            var    reservedSeatsForTheShow = _searchService.GetReservedSeatsByShow(bookTicketRequest.ShowID);

            if (reservedSeatsForTheShow.Intersect(bookTicketRequest.SeatIDs).Any())
            {
                throw new Models.Core.AppValidationException("One or more seats are already reserved, please try other seats.");
            }
            var pricePerUnit = _showsRepository.GetPriceByShow(bookTicketRequest.ShowID);

            if (pricePerUnit != null)
            {
                using (var transaction = _bookMyTicketDBContext.Database.BeginTransaction())
                {
                    ticket = new Ticket
                    {
                        ShowID = bookTicketRequest.ShowID,
                        Price  = (decimal)(pricePerUnit * bookTicketRequest.SeatIDs.Count),
                        UserID = _clientContext.UserInfo.ID
                    };

                    ticket.ID            = _ticketsRepository.InsertTicket(_mapper.Map <Entities.Ticket>(ticket));
                    ticket.ReservedSeats = new List <long>();

                    bookTicketRequest.SeatIDs.ForEach(seat =>
                    {
                        var reservation = new Reservation()
                        {
                            TicketID = ticket.ID,
                            SeatID   = seat
                        };
                        _reservationsRepository.InsertReservation(_mapper.Map <Entities.Reservation>(reservation));
                        ticket.ReservedSeats.Add(seat);
                    });
                    transaction.Commit();
                }
            }
            return(ticket);
        }