Skip to content

Commit d1171ac

Browse files
tdykstragewarren
andauthored
System.Text.Json - rearrange order of refs to 6.0 feature (#26501)
Co-authored-by: Genevieve Warren <[email protected]>
1 parent aab28df commit d1171ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Learn how to migrate from Newtonsoft.Json to System.Text.Json. Inc
44
author: tdykstra
55
ms.author: tdykstra
66
no-loc: [System.Text.Json, Newtonsoft.Json]
7-
ms.date: 08/25/2021
7+
ms.date: 10/13/2021
88
zone_pivot_groups: dotnet-version
99
helpviewer_keywords:
1010
- "JSON serialization"
@@ -894,15 +894,15 @@ The `Newtonsoft.Json` `WriteRawValue` method writes raw JSON where a value is ex
894894

895895
::: zone pivot="dotnet-5-0,dotnet-core-3-1"
896896

897-
The `Newtonsoft.Json` `WriteRawValue` method writes raw JSON where a value is expected. <xref:System.Text.Json> has no direct equivalent, but here's a workaround that ensures only valid JSON is written:
897+
The `Newtonsoft.Json` `WriteRawValue` method writes raw JSON where a value is expected. There is an equivalent method, <xref:System.Text.Json.Utf8JsonWriter.WriteRawValue%2A?displayProperty=nameWithType>, in .NET 6. For more information, see [Write raw JSON](system-text-json-use-dom-utf8jsonreader-utf8jsonwriter.md?pivots=dotnet-6-0#write-raw-json).
898+
899+
For versions earlier than 6.0, <xref:System.Text.Json?displayProperty=fullName> has no equivalent method for writing raw JSON. However, the following workaround ensures only valid JSON is written:
898900

899901
```csharp
900902
using JsonDocument doc = JsonDocument.Parse(string);
901903
doc.WriteTo(writer);
902904
```
903905

904-
There is a <xref:System.Text.Json.Utf8JsonWriter.WriteRawValue%2A?displayProperty=nameWithType> method in .NET 6. For more information, see [Write raw JSON](system-text-json-use-dom-utf8jsonreader-utf8jsonwriter.md?pivots=dotnet-6-0#write-raw-json).
905-
906906
::: zone-end
907907

908908
### Customize character escaping

0 commit comments

Comments
 (0)