条件判断添加空或者非空;调整相等与否的判断

usertest
zhangxiaofeng 3 months ago
parent 95e95eab62
commit e5d9808da5

@ -56,13 +56,17 @@ namespace DS.Module.Core.Condition
switch (item.Operator)
{
case "equal":
itemResult = valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) == true; break;
itemResult = (valStr == null && item.Value == null) || valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) == true; break;
case "not_equal":
itemResult = valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) != true; break;
itemResult = (valStr != null || item.Value != null) && valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) != true; break;
case "contains":
itemResult = valStr?.Contains(item.Value, StringComparison.OrdinalIgnoreCase) == true; break;
case "not_contain":
itemResult = valStr?.Contains(item.Value, StringComparison.OrdinalIgnoreCase) != true; break;
case "empty":
itemResult = string.IsNullOrWhiteSpace(valStr) == true; break;
case "not_empty":
itemResult = string.IsNullOrWhiteSpace(valStr) != true; break;
case "start_with":
itemResult = valStr?.StartsWith(item.Value, StringComparison.OrdinalIgnoreCase) == true; break;
case "end_with":

Loading…
Cancel
Save