Interface IJsonSerializationCallbacks
- Namespace
- Nerdbank.Json
- Assembly
- Nerdbank.Json.dll
Receives notifications immediately before an object is serialized and after it is deserialized.
public interface IJsonSerializationCallbacks
Remarks
These callbacks are invoked by shape-generated object converters. A custom converter controls its own representation and is responsible for invoking callbacks when that is appropriate.
Callback exceptions are propagated to the serializer caller. Implementations should avoid initiating another top-level serialization operation for the same object.
Methods
OnAfterDeserialize()
Restores invariants or computed state after the object's constructor, properties, and extension data have been applied.
void OnAfterDeserialize()
OnBeforeSerialize()
Performs any final validation or state preparation before the object's properties are read for serialization.
void OnBeforeSerialize()