<PackageReference Include="System.Text.Json" Version="6.0.5" />

ReferenceHandler

public abstract class ReferenceHandler
This class defines how the JsonSerializer deals with references on serialization and deserialization.
public static ReferenceHandler IgnoreCycles { get; }

Ignores an object when a reference cycle is detected during serialization.

public static ReferenceHandler Preserve { get; }

Metadata properties will be honored when deserializing JSON objects and arrays into reference types and written when serializing reference types. This is necessary to create round-trippable JSON from objects that contain cycles or duplicate references.

protected ReferenceHandler()

Initializes a new instance of the ReferenceHandler class.

Returns the ReferenceResolver used for each serialization call.