Json.NET sessions for before and after

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

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

+5
source share
1 answer

The latest version of Json.NET supports serialization callbacks .

+5
source

All Articles