private Models.TicketType TransformDaoToBusinessLogicTicketType(TicketTypeDao ticketTypeDao) { var age = _age.GetAgeById(ticketTypeDao.AgeId); return(new Models.TicketType() { Id = ticketTypeDao.Id, Name = ticketTypeDao.Name, Type = ticketTypeDao.Type, Days = ticketTypeDao.Days, Age = age.Type }); }
public ActionResult <Models.Age> GetAgeById(int ageId) { try { return(Ok(new OkResponse <Models.Age>(_age.GetAgeById(ageId)))); } catch (AgeNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(BadRequest(new ErrorResponse(e.Message, new List <string>() { "ageId" }))); } }