From 12b1a143195a2bf0e368d34a30316443cba432af Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 31 Oct 2023 16:25:42 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/NiagaraDataSynchronizeRepository.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index f20749a..a0acdbc 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -443,10 +443,18 @@ namespace Repository.BackendRepository.Implement using (TransactionScope scope = new TransactionScope((TransactionScopeOption)TransactionScopeAsyncFlowOption.Enabled)) { await conn.ExecuteAsync(sb.ToString()); - await conn.ExecuteAsync(sb2.ToString()); } sb.Clear(); + } + + if (sb2.Length > 0) + { + using (TransactionScope scope = new TransactionScope((TransactionScopeOption)TransactionScopeAsyncFlowOption.Enabled)) + { + await conn.ExecuteAsync(sb2.ToString()); + } + sb2.Clear(); } }