コード例 #1
0
        /// <summary>
        /// 增加auto mapper自动化映射,注册了全局单例IMapper
        /// </summary>
        /// <param name="kernelService"></param>
        /// <returns></returns>
        public static IKernelServices AddAutoMapperByConvention(this IKernelServices kernelService)
        {
            var assemblies =
                ReflectionHelper.GetReferredAssemblies(typeof(AutoMapperExtensions).Assembly, DependencyContext.Default);

            return(kernelService.AddAutoMapperByConvention(assemblies));
        }
コード例 #2
0
 public void Configure(IKernelServices kernelService)
 {
     if (!Options.Value.Enable)
     {
         return;
     }
     kernelService.AddAutoMapperByConvention();
 }