From 811a1fd4652a998e6385cefcd3d910a16aecddfb Mon Sep 17 00:00:00 2001 From: dev02 Date: Sat, 31 Dec 2022 17:03:17 +0800 Subject: [PATCH] fix problem of use result --- .../Implement/NiagaraDataSynchronizeRepository.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 6db5b2e..804cc30 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -259,7 +259,8 @@ namespace Repository.BackendRepository.Implement data.niagara_tags + "', '" + data.device_system_tag + "', now(), now() );"); } - foreach (var data in result) + + foreach (var data in result2) { sb2.Append($@"INSERT device_kind (device_kind_guid, device_building_tag, device_system_tag, device_name_tag, device_normal_flashing, device_close_flashing, device_error_flashing, device_error_independent, @@ -267,6 +268,7 @@ namespace Repository.BackendRepository.Implement VALUES (uuid(), '" + data.device_building_tag + "', '" + data.device_system_tag + "', '" + data.device_name_tag + "', 0, 0, 1, 0, 'B43E3CA7-96DD-4FC7-B6E6-974ACC3B0878', now());"); } + if (sb.Length > 0) { await conn.ExecuteAsync(sb.ToString());