From 830e363b6da587f6029ab575520177f716c8f362 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 6 Sep 2022 21:48:25 +0800 Subject: [PATCH] VAT code --- Src/Asp.Net/SqlSugar/SqlSugarClient.cs | 8 ++++---- Src/Asp.NetCore2/SqlSugar/SqlSugarClient.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs b/Src/Asp.Net/SqlSugar/SqlSugarClient.cs index cb0452236..431f4aed4 100644 --- a/Src/Asp.Net/SqlSugar/SqlSugarClient.cs +++ b/Src/Asp.Net/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; } 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; }