From afb9a0d9f5da0fdfe1d1478a5c7ec23bd39f4bff Mon Sep 17 00:00:00 2001 From: LemonNoCry <773596523@qq.com> Date: Fri, 3 Nov 2023 09:22:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=B7=BB=E5=8A=A0=E5=A4=87=E7=94=A8=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Blog.Core.Extensions/ServiceExtensions/SqlsugarSetup.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Blog.Core.Extensions/ServiceExtensions/SqlsugarSetup.cs b/Blog.Core.Extensions/ServiceExtensions/SqlsugarSetup.cs index eb012394..99133fe1 100644 --- a/Blog.Core.Extensions/ServiceExtensions/SqlsugarSetup.cs +++ b/Blog.Core.Extensions/ServiceExtensions/SqlsugarSetup.cs @@ -83,10 +83,12 @@ public static void AddSqlsugarSetup(this IServiceCollection services) { BaseDBConfig.MainConfig = config; } - - //复用连接 - if (m.ConnId.ToLower().StartsWith(MainDb.CurrentDbConnId.ToLower())) + else if (m.ConnId.ToLower().StartsWith(MainDb.CurrentDbConnId.ToLower())) + { + //复用连接 BaseDBConfig.ReuseConfigs.Add(config); + } + BaseDBConfig.ValidConfig.Add(config); }