internal static Manager ManagerSetToManager(this ManagerSet manager) { Mapper.Initialize(cfg => cfg.CreateMap <ManagerSet, Manager>()); var result = Mapper.Map <ManagerSet, Manager>(manager); return(result); }
internal static ManagerSet ManagerToManagerSet(this Manager manager) { Mapper.Initialize(cfg => cfg.CreateMap <Report, ReportSet>()); Mapper.Initialize(cfg => cfg.CreateMap <ICollection <Report>, ICollection <ReportSet> >()); var result = new ManagerSet() { Id = manager.Id, Name = manager.Name, ReportSet = new List <ReportSet>() }; result.ReportSet = Mapper.Map <ICollection <Report>, ICollection <ReportSet> >(manager.Report); return(result); }