Skip to content

Conversation

@tdykstra
Copy link
Contributor

@tdykstra tdykstra commented Jan 12, 2021

Copy link
Contributor

@luisquintanilla luisquintanilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdykstra LGTM.

Copy link
Contributor

@layomia layomia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!


::: zone pivot="dotnet-5-0"

By default, reference data is only cached for each call to <xref:System.Text.Json.JsonSerializer.Serialize%2A> or <xref:System.Text.Json.JsonSerializer.Deserialize%2A>. To persist references from one `Serialize`/`Deserialize` call to another one, root the <xref:System.Text.Json.Serialization.ReferenceResolver> instance in the call site of `Serialize`/`Deserialize`. The following code shows an example for this scenario:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this example covers serialization, maybe mention somewhere in this section that a similar approach can be adopted for deserialization.

@tdykstra tdykstra merged commit 22ed8e5 into dotnet:master Feb 16, 2021
@tdykstra tdykstra deleted the presrefconv branch February 16, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReferenceHandler.Preserve does not work well with JsonConverters

5 participants