From 333545eb1482c8f4e9a69ea3b4574cb472d36656 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 31 Aug 2022 20:11:30 +0800 Subject: [PATCH] Update uow --- Src/Asp.Net/SqlSugar/SugarUnitOfWork.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/SugarUnitOfWork.cs b/Src/Asp.Net/SqlSugar/SugarUnitOfWork.cs index 0775debb1..5bee50c63 100644 --- a/Src/Asp.Net/SqlSugar/SugarUnitOfWork.cs +++ b/Src/Asp.Net/SqlSugar/SugarUnitOfWork.cs @@ -39,7 +39,7 @@ namespace SqlSugar { this.Tenant.RollbackTran(); } - if (IsClose == false) + if (this.Db.Ado.Transaction==null&&IsClose == false) { this.Db.Close(); } @@ -81,7 +81,7 @@ namespace SqlSugar this.Tenant.CommitTran(); IsCommit = true; } - if (this.IsClose == false) + if (this.Db.Ado.Transaction==null&&this.IsClose == false) { this.Db.Close(); IsClose = true;