示例#1
0
        /// <summary>
        /// 注入AutoMapper映射
        /// </summary>
        /// <param name="services"></param>
        public static void AddAutoMapperStartUp(this IServiceCollection services)
        {
            services.NotNull(nameof(IServiceCollection));

            services.AddAutoMapper(typeof(StAutoMapperProFile), typeof(StAutoMapperIdentityProFile));
            AutoMapperExtension.InitMapper(services.BuildServiceProvider().GetService <IMapper>());//初始化IMapper扩展
        }