public ReserveTicketResponse ReserveTicket(ReserveTicketRequest reserveTicketRequest)
        {
            ReserveTicketResponse response = new ReserveTicketResponse();

            try
            {
                Event Event = _eventRepository.FindBy(new Guid(reserveTicketRequest.EventId));
                TicketReservation reservation;

                if (Event.CanReserveTicket(reserveTicketRequest.TicketQuantity))
                {
                    reservation = Event.ReserveTicket(reserveTicketRequest.TicketQuantity);
                    _eventRepository.Save(Event);
                    response = reservation.ConvertToReserveTicketResponse();
                    response.Success = true;
                }
                else
                {
                    response.Success = false;
                    response.Message = String.Format("There are {0} ticket(s) available.",Event.AvailableAllocation());
                }
            }
            catch (Exception ex)
            {
                // Shield exceptions
                response.Message = ErrorLog.GenerateErrorRefMessageAndLog(ex);
                response.Success = false;
            }

            return response;
        }
 public static ReserveTicketResponse ConvertToReserveTicketResponse(this TicketReservation ticketReservation)
 {
     var response = new ReserveTicketResponse()
                        {
                            EventId = ticketReservation.Event.Id.ToString(),
                            EventName = ticketReservation.Event.Name,
                            NoOfTickets = ticketReservation.TicketQuantity,
                            ExpirationDate = ticketReservation.ExpiryTime,
                            ReservationNumber = ticketReservation.Id.ToString()
                        };
     return response;
 }