public TicketDTO TransformWithPerformance(Ticket t) { if (t == null) { return(null); } return(new TicketDTO { TicketId = t.TicketId, TicketNr = t.TicketNr, DatePurchased = t.DatePurchased, TicketType = _ticketTypeFactory.Transform(t.TicketType), Performance = _performanceFactory.Transform(t.Performance) }); }
public PerformanceDTO AddNewPerformance(PerformanceDTO newPerformance) { try { var p = _performanceFactory.Transform(newPerformance); _uow.Performances.Add(p); _uow.SaveChanges(); var added = _uow.Performances.Find(p.PerformanceId); return(_performanceFactory.Transform(added)); } catch (DBConcurrencyException) { return(null); } }