From d0f01f571918ae942349068776fa7fb70f3ab5cd Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期三, 28 八月 2024 16:20:18 +0800 Subject: [PATCH] 更新设备信息表从表导入问题 --- WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs b/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs index 5134821..dec0451 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_Core/Utilities/EntityProperties.cs @@ -29,7 +29,7 @@ if (propertyInfo != null) { sugarColumn = propertyInfo.GetCustomAttribute<SugarColumn>(); - dbType = propertyInfo != null ? propertyInfo.GetProperWithDbType() : SqlDbTypeName.NVarChar; + dbType = propertyInfo.PropertyType != null ? propertyInfo.GetProperWithDbType() : SqlDbTypeName.NVarChar; } dbType = dbType.ToLower(); string val = value?.ToString(); @@ -128,6 +128,7 @@ { typeof(byte),SqlDbTypeName.Int },//绫诲瀷寰呭畬 { typeof(Guid),SqlDbTypeName.UniqueIdentifier} }; + public static string GetProperWithDbType(this PropertyInfo propertyInfo) { bool result = ProperWithDbType.TryGetValue(propertyInfo.PropertyType, out string value); -- Gitblit v1.9.3