wanshenmean
2026-03-12 f56441867f2cc77567f97a92348a5d878f0dca05
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Filter/AutoMapperSetup.cs
@@ -1,7 +1,10 @@
namespace WIDESEA_WMSServer.Filter
using Mapster;
using MapsterMapper;
namespace WIDESEA_WMSServer.Filter
{
    /// <summary>
    /// Automapper 启动服务
    /// Mapster 启动服务
    /// </summary>
    public static class AutoMapperSetup
    {
@@ -9,8 +12,10 @@
        {
            if (services == null) throw new ArgumentNullException(nameof(services));
            services.AddAutoMapper(typeof(AutoMapperConfig));
            AutoMapperConfig.RegisterMappings();
            var config = TypeAdapterConfig.GlobalSettings;
            AutoMapperConfig.RegisterMappings(config);
            services.AddSingleton(config);
            services.AddScoped<IMapper, ServiceMapper>();
        }
    }
}
}