Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Text.​Json.​Serialization.​ReferenceResolver

Assembly: System.Text.Json

Inheritance: object → ReferenceResolver

Defines how the <see cref="T:System.Text.Json.JsonSerializer" /> deals with references on serialization and deserialization. Defines the core behavior of preserving references on serialization and deserialization.

Methods

public void
AddReference​(string referenceId, object value)
Adds an entry to the bag of references using the specified ID and value. This method gets called when an $id metadata property from a JSON object is read.
referenceId The identifier of the JSON object or array.
value The value of the CLR reference type object that results from parsing the JSON object.
public string
GetReference​(object value, Boolean& alreadyExists)
public object
ResolveReference​(string referenceId)
Returns the CLR reference type object related to the specified reference ID. This method is called when $ref metadata property is read.
Returns The reference type object related to the specified reference ID.
referenceId The reference ID related to the returned object.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object