From a2763d13d82ce5b5ccb6886f6f3324ebe4d064e5 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 31 Aug 2022 20:23:59 +0800 Subject: [PATCH] Add db.Ado.IsNoTran --- Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs | 4 ++++ Src/Asp.Net/SqlSugar/Interface/IAdo.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index a8f590e79..a79e23aa4 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -187,6 +187,10 @@ namespace SqlSugar { return this.Transaction != null; } + public virtual bool IsNoTran() + { + 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 00a76be1e..10c33d0e0 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IAdo.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IAdo.cs @@ -21,7 +21,7 @@ namespace SqlSugar void ExecuteBefore(string sql, SugarParameter[] pars); void ExecuteAfter(string sql, SugarParameter[] pars); bool IsAnyTran(); - + bool IsNoTran(); bool IsEnableLogEvent{get;set;} StackTraceInfo SqlStackTrace { get; } IDataParameterCollection DataReaderParameters { get; set; }