|
|
@ -3,6 +3,7 @@ using System.Collections.Generic; |
|
|
|
using System.Globalization; |
|
|
|
using System.Linq; |
|
|
|
using System.Linq.Expressions; |
|
|
|
using System.Reflection; |
|
|
|
using System.Text.Json; |
|
|
|
using Volo.Abp; |
|
|
|
|
|
|
@ -204,6 +205,29 @@ public static class FilterExtensions |
|
|
|
{ |
|
|
|
var parameterExpression = Expression.Parameter(typeof(T), "p"); |
|
|
|
Type lstType = typeof(List<>).MakeGenericType(propertyType); |
|
|
|
|
|
|
|
if (propertyType.IsEnum) |
|
|
|
{ |
|
|
|
var valueArrayStrings = JsonSerializer.Deserialize<List<string>>(filter.Value); |
|
|
|
List<object> newValues = new List<object>(); |
|
|
|
|
|
|
|
var enumValues = propertyType.GetEnumValues(); |
|
|
|
|
|
|
|
foreach (var valueArray in valueArrayStrings) |
|
|
|
{ |
|
|
|
foreach (var enumValue in enumValues) |
|
|
|
{ |
|
|
|
if (enumValue.ToString() == valueArray) |
|
|
|
{ |
|
|
|
newValues.Add(enumValue); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var newValue = JsonSerializer.Serialize(newValues); |
|
|
|
filter.Value = newValue; |
|
|
|
} |
|
|
|
|
|
|
|
object propertyValue = JsonSerializer.Deserialize(filter.Value, lstType); |
|
|
|
if (propertyValue != null) |
|
|
|
{ |
|
|
|