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

ReferenceHandler

public abstract class ReferenceHandler
This class defines how the JsonSerializer deals with references on serialization and deserialization.
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.