6

I am using Json.NET to serialize an object graph. For each object that is serialized or deserialized, I want to call a method on that object before the serialization takes place. For e.g. all my objects implement an interface INotified with a method OnSerializing. I want OnSerializing to be called before the object is serialized.

Is there a way to achieve this without having to touch the Json.NET source code?

1 Answer 1

8

The latest version of Json.NET supports serialization callbacks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.