From dfce86e800b71b594702e10d1c6d210c1dff54b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Thu, 12 Jun 2025 11:22:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=82=E6=95=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XCode/Membership/字典参数.Biz.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/XCode/Membership/字典参数.Biz.cs b/XCode/Membership/字典参数.Biz.cs index df03cfb14..6646cf21a 100644 --- a/XCode/Membership/字典参数.Biz.cs +++ b/XCode/Membership/字典参数.Biz.cs @@ -1,5 +1,4 @@ using System.Collections; -using NewLife; using NewLife.Collections; using NewLife.Data; using NewLife.Reflection; @@ -124,10 +123,10 @@ public partial class Parameter : Entity #region 业务操作 /// 根据种类返回数据 /// - public Object GetValue() + public Object? GetValue() { - var str = Value; - if (str.IsNullOrEmpty()) str = LongValue; + var str = Value?.Trim(); + if (str.IsNullOrEmpty()) str = LongValue?.Trim(); if (str.IsNullOrEmpty()) return null; switch (Kind) @@ -240,11 +239,11 @@ public partial class Parameter : Entity /// public T[] GetList() { - var str = Value; - if (str.IsNullOrEmpty()) str = LongValue; + var str = Value?.Trim(); + if (str.IsNullOrEmpty()) str = LongValue?.Trim(); - var arr = Value.Split(",", ";"); - return arr.Select(e => e.ChangeType()).ToArray(); + var arr = Value.Split(",", ";", ","); + return arr.Select(e => e.ChangeType()!).ToArray(); } /// 获取名值对 @@ -253,11 +252,11 @@ public partial class Parameter : Entity /// public IDictionary GetHash() { - var str = Value; - if (str.IsNullOrEmpty()) str = LongValue; + var str = Value?.Trim(); + if (str.IsNullOrEmpty()) str = LongValue?.Trim(); var dic = Value.SplitAsDictionary("=", ","); - return dic.ToDictionary(e => e.Key.ChangeType(), e => e.Value.ChangeType()); + return dic.ToDictionary(e => e.Key.ChangeType()!, e => e.Value.ChangeType()!); } /// 设置列表