Преглед на файлове

Fixed Incorrect Deserialization of FilterConstant values

Frank van den Bos преди 2 години
родител
ревизия
2a704c860c
променени са 1 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. 8 3
      InABox.Core/CoreUtils.cs

+ 8 - 3
InABox.Core/CoreUtils.cs

@@ -545,9 +545,14 @@ namespace InABox.Core
             if (value is string && type == typeof(byte[]))
             if (value is string && type == typeof(byte[]))
                 return Convert.FromBase64String(value as string);
                 return Convert.FromBase64String(value as string);
 
 
-            //if (value is string && type == typeof(Memo))
-            //	return new Memo(value as String); // { _data = value as string };
-
+            if (value is FilterConstant && type == typeof(DateTime))
+            {
+                if (Equals(FilterConstant.Now, value))
+                    return DateTime.Now;
+                if (Equals(FilterConstant.Today, value))
+                    return DateTime.Today;
+            }
+            
             if (!(value is IConvertible))
             if (!(value is IConvertible))
                 return value;
                 return value;