Beispiel #1
0
        public PerformanceDTO TransformWithPerformers(Performance p)
        {
            var dto = Transform(p);

            if (dto == null)
            {
                return(null);
            }
            dto.Performers = p.PerformancePerformers.Select(pp => _performerFactory.Transform(pp.Performer)).ToList();
            return(dto);
        }
 public PerformerDTO AddNewPerformer(PerformerDTO newPerformer)
 {
     try
     {
         var p = _performerFactory.Transform(newPerformer);
         _uow.Performers.Add(p);
         _uow.SaveChanges();
         return(_performerFactory.Transform(_uow.Performers.Find(p.PerformerId)));
     }
     catch (DBConcurrencyException)
     {
         return(null);
     }
 }