From cce642111ff2bfa5c348d5733d77e7ce5e396d54 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 08 四月 2026 17:53:27 +0800
Subject: [PATCH] 111

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/AutoMapperSetup.cs |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/AutoMapperSetup.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/AutoMapperSetup.cs
index d1ac9d1..c6cac5f 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/AutoMapperSetup.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Filter/AutoMapperSetup.cs
@@ -1,16 +1,22 @@
-锘縩amespace WIDESEAWCS_WCSServer.Filter
+锘縰sing Mapster;
+using MapsterMapper;
+
+namespace WIDESEAWCS_WCSServer.Filter
 {
     /// <summary>
-    /// Automapper 鍚姩鏈嶅姟
+    /// Mapster 鍚姩鏈嶅姟
     /// </summary>
-    public static class AutoMapperSetup
+    public static class MapsterSetup
     {
-        public static void AddAutoMapperSetup(this IServiceCollection services)
+        public static void AddMapsterSetup(this IServiceCollection services)
         {
             if (services == null) throw new ArgumentNullException(nameof(services));
 
-            services.AddAutoMapper(typeof(AutoMapperConfig));
-            AutoMapperConfig.RegisterMappings();
+            TypeAdapterConfig typeAdapterConfig = new TypeAdapterConfig();
+            MapsterConfig.RegisterMappings(typeAdapterConfig);
+
+            services.AddSingleton(typeAdapterConfig);
+            services.AddScoped<IMapper, ServiceMapper>();
         }
     }
 }

--
Gitblit v1.9.3