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 }); }
public ActionResult <Models.Age> GetSellingPointById(int sellingPointId) { try { return(Ok(new OkResponse <Models.SellingPoint>(_sellingPoint.GetSellingPointById(sellingPointId)))); } catch (SellingPointNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(BadRequest(new ErrorResponse(e.Message, new List <string>() { "sellingPointId" }))); } }