using Mapster; using MapsterMapper; namespace WIDESEA_WMSServer.Filter { /// /// Mapster 启动服务 /// public static class AutoMapperSetup { public static void AddAutoMapperSetup(this IServiceCollection services) { if (services == null) throw new ArgumentNullException(nameof(services)); var config = TypeAdapterConfig.GlobalSettings; AutoMapperConfig.RegisterMappings(config); services.AddSingleton(config); services.AddScoped(); } } }