Enum ReferencePreservationMode
- Namespace
- Nerdbank.Json
- Assembly
- Nerdbank.Json.dll
Controls whether reference equality is preserved in serialized object graphs.
public enum ReferencePreservationMode
Fields
AllowCycles = 2Repeated references are preserved and reference cycles are allowed.
This mode uses the same
$id/$refwire format as RejectCycles, but additionally permits an object to reference itself directly or indirectly. During deserialization, mutable objects, collections, and dictionaries are registered before their members are populated so that back-references resolve to the object under construction. Immutable or constructor-bound objects cannot be registered early, so a back-reference to such an object that is still being constructed fails with a clear error.Off = 0References are not preserved.
RejectCycles = 1Repeated references are preserved and reference cycles are rejected.