From eed32c6bd60ce1de82126590417e41caa34279b4 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 30 Aug 2022 16:48:26 +0800 Subject: [PATCH] Update Multi-tenant BUG --- Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs b/Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs index cb0452236..431f4aed4 100644 --- a/Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs @@ -769,16 +769,16 @@ namespace SqlSugar if (db.Context == null) { db.Context = new SqlSugarProvider(db.ConnectionConfig); - if (_IsAllTran&&db.Context.Ado.Transaction==null) - { - db.Context.Ado.BeginTran(); - } } var intiAop=db.Context.Aop; if (db.Context.CurrentConnectionConfig.AopEvents == null) { db.Context.CurrentConnectionConfig.AopEvents = new AopEvents(); } + if (_IsAllTran && db.Context.Ado.Transaction == null) + { + db.Context.Ado.BeginTran(); + } return db.Context; }