protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            AutoMaperConfig.RegisterMappings();
        }
        public static void AddAutoMapperSetup(this IServiceCollection services)
        {
            if (services == null)
            {
                //是否为空,抛出异常
                throw new ArgumentNullException(nameof(services));
            }
            //添加服务
            services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
            //services.AddAutoMapper();
            //启动配置
            var config = AutoMaperConfig.RegisterMappings();

            config.CreateMapper();
        }