public PerformanceDTO Transform(Performance p) { if (p == null) { return(null); } return(new PerformanceDTO { PerformanceId = p.PerformanceId, TicketInfo = p.TicketInfo, PerformanceDescription = p.PerformanceDescription, PerformanceTime = p.PerformanceTime, Event = _eventFactory.Transform(p.Event), Location = _locationFactory.Transform(p.Location) }); }
/// <summary> /// /// </summary> /// <param name="newEvent"></param> /// <returns></returns> public EventDTO AddNewEvent(EventDTO newEvent) { try { var e = _eventFactory.Transform(newEvent); _uow.Events.Add(e); _uow.SaveChanges(); return(_eventFactory.Transform(_uow.Events.Find(e.EventId))); } catch (DBConcurrencyException) { return(null); } }