Explorar el Código

Fixed Issue with Serializing/Deserializing changes to User-defined properties

frogsoftware hace 1 año
padre
commit
ac9328ac36
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6 4
      InABox.RPC.Shared/Commands/Save/RpcSaveResult.cs

+ 6 - 4
InABox.RPC.Shared/Commands/Save/RpcSaveResult.cs

@@ -25,8 +25,9 @@ namespace InABox.Rpc
                 foreach (var (key, value) in delta)
                 {
                     writer.Write(key);
-                    var prop = CoreUtils.GetProperty(Type, key);
-                    writer.WriteBinaryValue(prop.PropertyType, value);
+                    var prop = DatabaseSchema.Property(Type, key);
+                    //var prop = CoreUtils.GetProperty(Type, key);
+                    writer.WriteBinaryValue(prop?.PropertyType ?? typeof(object), value);
                 }
             }
         }
@@ -46,8 +47,9 @@ namespace InABox.Rpc
                 for (int iKey = 0; iKey < keycount; iKey++)
                 {
                     var key = reader.ReadString();
-                    var prop = CoreUtils.GetProperty(Type, key);
-                    var value = reader.ReadBinaryValue(prop.PropertyType);
+                    var prop = DatabaseSchema.Property(Type, key);
+                    //var prop = CoreUtils.GetProperty(Type, key);
+                    var value = reader.ReadBinaryValue(prop?.PropertyType ?? typeof(object));
                     delta[key] = value;
                 }
                 deltas.Add(delta);