using Mapster; using MapsterMapper; namespace WIDESEAWCS_WCSServer.Filter { /// /// Mapster 启动服务 /// public static class MapsterSetup { public static void AddMapsterSetup(this IServiceCollection services) { if (services == null) throw new ArgumentNullException(nameof(services)); TypeAdapterConfig typeAdapterConfig = new TypeAdapterConfig(); MapsterConfig.RegisterMappings(typeAdapterConfig); services.AddSingleton(typeAdapterConfig); services.AddScoped(); } } }