Exemplo n.º 1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="mapperConfigAssemblyStrings">映射配置程序集名称的长格式</param>
        /// <param name="isAssertConfigurationIsValid">断言配置是否正确</param>
        public static void Initialize(IEnumerable <string> mapperConfigAssemblyStrings, bool isAssertConfigurationIsValid = false)
        {
            var mapperConfigFactory = new ReflectionMapperConfigFactory(mapperConfigAssemblyStrings);

            mapper = new AutoMapperImp(mapperConfigFactory, isAssertConfigurationIsValid);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="dependencyResolver">依赖注入解析器</param>
        /// <param name="isAssertConfigurationIsValid">断言配置是否正确</param>
        public static void Initialize(IDependencyResolver dependencyResolver, bool isAssertConfigurationIsValid = false)
        {
            var mapperConfigFactory = new IocMapperConfigFactory(dependencyResolver);

            mapper = new AutoMapperImp(mapperConfigFactory, isAssertConfigurationIsValid);
        }
 public void InitializeForUTTest()
 {
     IMapper mapper = new AutoMapperImp(new AddressMapperConfig(), true);
 }