You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #82 I've found out that SerializerOptions.PreserveObjectReferences actually never worked for user-defined objects. Example:
varserializer=newSerializer(newSerializerOptions(preserveObjectReferences:true));varserializerSession=newSerializerSession(serializer);vardeserializerSession=newDeserializerSession(serializer);using(varstream=newMemoryStream()){varo=newMyClass{First="hello",Second=123};serializer.Serialize(o,stream,serializerSession);// serialize object 1st timestream.Position=0;serializer.Serialize(o,stream,serializerSession);// serialize it again using the same session}
First serialization passes, but second one throws ArgumentException: An item with the same key has already been added.. From what I've seen, generated object serializer simply doesn't look it object has been saved previously before trying to serialize it again.
The text was updated successfully, but these errors were encountered:
While working on #82 I've found out that
SerializerOptions.PreserveObjectReferences
actually never worked for user-defined objects. Example:First serialization passes, but second one throws ArgumentException: An item with the same key has already been added.. From what I've seen, generated object serializer simply doesn't look it object has been saved previously before trying to serialize it again.
The text was updated successfully, but these errors were encountered: