From d1a2afa67032339c2eb1019a02c6b6d036c0bdb1 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期一, 23 九月 2024 09:09:40 +0800 Subject: [PATCH] 1 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs" index 1f75580..af87398 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs" @@ -162,15 +162,19 @@ Type[] types = propertyInfo.PropertyType.GenericTypeArguments; if (types.Length == 1) { - string str = value.Serialize(); - if (str == "[]") + if (tempValue.ChangeType(property.PropertyType).ToString() == propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1].ChangeType(property.PropertyType).ToString()) { - return (false, $"銆恵property.Name}銆戝睘鎬х殑鍊间负銆恵propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1]}銆戞椂銆恵propertyInfo.Name}銆戝睘鎬х殑鍊间笉鍙负绌�", data); + string str = value.Serialize(); + if (str == "[]") + { + return (false, $"銆恵property.Name}銆戝睘鎬х殑鍊间负銆恵propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1]}銆戞椂銆恵propertyInfo.Name}銆戝睘鎬х殑鍊间笉鍙负绌�", data); + } } + } else if (types.Length == 0) { - if (tempValue.ChangeType(property.PropertyType) != propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1].ChangeType(property.PropertyType) && value == null && string.IsNullOrEmpty(value.ToString())) + if (tempValue.ChangeType(property.PropertyType).ToString() == propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1].ChangeType(property.PropertyType).ToString() && value == null && string.IsNullOrEmpty(value.ToString())) { return (false, $"銆恵property.Name}銆戝睘鎬х殑鍊间负銆恵propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1]}銆戞椂銆恵propertyInfo.Name}銆戝睘鎬х殑鍊间笉鍙负绌�", data); } -- Gitblit v1.9.3