mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-01 10:10:16 +08:00
Update db.Ado.Use Tran
This commit is contained in:
parent
ff6b157b36
commit
ca48ee64d2
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user