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=new Serializer(new SerializerOptions(preserveObjectReferences:true));varserializerSession=new SerializerSession(serializer);vardeserializerSession=new DeserializerSession(serializer);using(varstream=new MemoryStream()){varo=new MyClass {First="hello",Second=123};
serializer.Serialize(o, stream, serializerSession);// serialize object 1st time
stream.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: