From b9b86f95055c7bc2011cdd29c646a40bbf82dc62 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 31 Aug 2022 20:13:45 +0800 Subject: [PATCH] Add IsAnyTran --- Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs | 4 ++++ Src/Asp.Net/SqlSugar/Interface/IAdo.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index 683b0331b..a8f590e79 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -183,6 +183,10 @@ namespace SqlSugar #endregion #region Transaction + public virtual bool IsAnyTran() + { + return this.Transaction != null; + } public virtual void BeginTran() { CheckConnection(); diff --git a/Src/Asp.Net/SqlSugar/Interface/IAdo.cs b/Src/Asp.Net/SqlSugar/Interface/IAdo.cs index cce2dae03..00a76be1e 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IAdo.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IAdo.cs @@ -20,6 +20,8 @@ namespace SqlSugar SqlSugarProvider Context { get; set; } void ExecuteBefore(string sql, SugarParameter[] pars); void ExecuteAfter(string sql, SugarParameter[] pars); + bool IsAnyTran(); + bool IsEnableLogEvent{get;set;} StackTraceInfo SqlStackTrace { get; } IDataParameterCollection DataReaderParameters { get; set; }