From 4e792ba9768e97a8038a5ab6be22262d8089ebe0 Mon Sep 17 00:00:00 2001 From: Gary <1511313969@qq.com> Date: Mon, 22 Sep 2025 02:58:59 +0000 Subject: [PATCH] =?UTF-8?q?update=20Yi.Abp.Net8/framework/Yi.Framework.Map?= =?UTF-8?q?ster/YiFrameworkMapsterModule.cs.=20=E8=87=AA=E5=8A=A8=E6=89=AB?= =?UTF-8?q?=E6=8F=8F=E6=89=80=E6=9C=89=E7=BB=A7=E6=89=BFIRegister=20?= =?UTF-8?q?=E7=9A=84Mapster=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gary <1511313969@qq.com> --- .../Yi.Framework.Mapster/YiFrameworkMapsterModule.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Yi.Abp.Net8/framework/Yi.Framework.Mapster/YiFrameworkMapsterModule.cs b/Yi.Abp.Net8/framework/Yi.Framework.Mapster/YiFrameworkMapsterModule.cs index 78f93dd1..9c250524 100644 --- a/Yi.Abp.Net8/framework/Yi.Framework.Mapster/YiFrameworkMapsterModule.cs +++ b/Yi.Abp.Net8/framework/Yi.Framework.Mapster/YiFrameworkMapsterModule.cs @@ -1,7 +1,8 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; using Volo.Abp.ObjectMapping; using Yi.Framework.Core; +using Mapster; namespace Yi.Framework.Mapster { @@ -22,7 +23,8 @@ namespace Yi.Framework.Mapster public override void ConfigureServices(ServiceConfigurationContext context) { var services = context.Services; - + // 扫描并注册所有映射配置 + TypeAdapterConfig.GlobalSettings.Scan(AppDomain.CurrentDomain.GetAssemblies()); // 注册Mapster相关服务 services.AddTransient(); services.AddTransient();