Browse Source

Fixed Serialization issue with InList Filters

frogsoftware 1 năm trước cách đây
mục cha
commit
9d7d4ffa7d
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      InABox.Core/Filter.cs

+ 5 - 1
InABox.Core/Filter.cs

@@ -1503,7 +1503,11 @@ namespace InABox.Core
         {
             Expression = reader.DeserialiseExpression(typeof(T));
             Operator = (Operator)reader.ReadByte();
-            Value = CoreUtils.ChangeType(DeserializeValue(reader), Expression.Type);
+            var val = DeserializeValue(reader);
+            var type = (Operator == Operator.InList || Operator == Operator.NotInList)
+                ? Expression.Type.MakeArrayType()
+                : Expression.Type;
+            Value = CoreUtils.ChangeType(val, type);
 
             Ands.Clear();
             var nAnds = reader.ReadInt32();