Update db.Ado.Use Tran

This commit is contained in:
sunkaixuan 2022-02-26 22:03:11 +08:00
parent ff6b157b36
commit ca48ee64d2

View File

@ -200,10 +200,12 @@ namespace SqlSugar
var result = new DbResult<bool>();
try
{
var isAutoConfig = this.Context.CurrentConnectionConfig.IsAutoCloseConnection;
this.BeginTran();
if (action != null)
action();
this.CommitTran();
this.Context.CurrentConnectionConfig.IsAutoCloseConnection = isAutoConfig;
result.Data = result.IsSuccess = true;
}
catch (Exception ex)