Esempio n. 1
0
        public IMapper Create(Assembly profilesAssembly, IFactory factory)
        {
            config.MappingAssemblies.Add(profilesAssembly);

            var cfg = new MapperConfigurationExpression();

            var mapContext = cfg.AddYuzuMappersFromContainer(factory);

            cfg.AddProfilesFromContainer(config.MappingAssemblies, factory);
            cfg.AddProfilesForAttributes(config.MappingAssemblies, mapContext, factory);
            cfg.ConstructServicesUsing(factory.GetInstance);

            var mapperConfig = new AutoMapper.MapperConfiguration(cfg);

            var autoMapper = new AutoMapper.Mapper(mapperConfig);

            return(new AutoMapperIntegration(autoMapper));
        }