From 9eeca6aa905cffea1c95d965b4790fbd20ce2275 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期五, 25 十月 2024 16:19:16 +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