public ActionResult <Models.Ticket> GetTicketById(int ticketId) { try { return(Ok(new OkResponse <Models.Ticket>(_ticket.GetTicketById(ticketId)))); } catch (TicketNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(BadRequest(new ErrorResponse(e.Message, new List <string>() { "ticketId" }))); } }
private Models.TicketPurchase TransformDaoToBusinessLogicTicketPurchase(TicketPurchaseDao ticketPurchaseDao) { var person = _person.GetPersonById(ticketPurchaseDao.PersonId); var ticket = _ticket.GetTicketById(ticketPurchaseDao.TicketId); var sellingPoint = _sellingPoint.GetSellingPointById(ticketPurchaseDao.SellingPointId); return(new Models.TicketPurchase() { Id = ticketPurchaseDao.Id, Ticket = ticket, Person = person, SellingPoint = sellingPoint, Date = ticketPurchaseDao.Date }); }