コード例 #1
0
        public static IServiceCollection AddMappers(this IServiceCollection services)
        {
            services.AddSingleton(MapperConfig.CreateMap());
            services.AddScoped <IMapper, ServiceMapper>();

            return(services);
        }
コード例 #2
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     MapperConfig.CreateMap();   //初始化 Mapper
 }
コード例 #3
0
 static PaymentQueries()
 {
     MapperConfig.CreateMap();
 }