public virtual void AssignRandomDataLists(int size, int listSize) { if (ListSize != listSize) { Size = size; ListSize = listSize; for (int i = 0; i < size; i++) { listOfListsOfBs.Add(DataGenerator.GetRandomList <B>(listSize)); listOfListsOfCs.Add(DataGenerator.GetRandomList <C>(listSize)); listOfListsOfDs.Add(DataGenerator.GetRandomList <D>(listSize)); listOfListsOfEs.Add(DataGenerator.GetRandomList <E>(listSize)); listOfListsOfFs.Add(DataGenerator.GetRandomList <F>(listSize)); listOfListsOfBDTOs.Add(DataGenerator.GetRandomList <BDto>(listSize)); listOfListsOfCDTOs.Add(DataGenerator.GetRandomList <CDto>(listSize)); listOfListsOfDDTOs.Add(DataGenerator.GetRandomList <DDto>(listSize)); listOfListsOfEDTOs.Add(DataGenerator.GetRandomList <EDto>(listSize)); listOfListsOfFDTOs.Add(DataGenerator.GetRandomList <FDto>(listSize)); listOfListsOfDeepBCDEFs.Add(DataGenerator.GetRandomDeepList <DeepBCDEF>(listSize)); listOfListsOfDeepCDEs.Add(DataGenerator.GetRandomDeepList <DeepCDE>(listSize)); } } }
static void TestAutomapper() { var config = new MapperConfiguration(cfg => { cfg.CreateMap <B, B>(); cfg.CreateMap <C, C>(); cfg.CreateMap <D, D>(); cfg.CreateMap <E, E>(); cfg.CreateMap <F, F>(); cfg.CreateMap <BDto, B>(); cfg.CreateMap <CDto, C>(); cfg.CreateMap <DDto, D>(); cfg.CreateMap <EDto, E>(); cfg.CreateMap <FDto, F>(); cfg.CreateMap <B, BDto>(); cfg.CreateMap <C, CDto>(); cfg.CreateMap <D, DDto>(); cfg.CreateMap <E, EDto>(); cfg.CreateMap <F, FDto>(); }); config.AssertConfigurationIsValid(); var _mapper = config.CreateMapper(); List <List <B> > listOfListsOfBs = new List <List <B> >(); for (int i = 0; i < 10; i++) { listOfListsOfBs.Add(DataGenerator.GetRandomList <B>(100)); } for (int i = 0; i < 10; i++) { var dest = _mapper.Map <List <B>, List <B> >(listOfListsOfBs[i]); var dest1 = _mapper.Map <List <B>, List <B> > (listOfListsOfBs[i]); } }