Skip to content

JsonDocument.Freeze Method

Definition

Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Source: JsonDocument.cs

Freeze()

Makes the document immutable.

public void Freeze()

Remarks

You can only create a new document from this document once it is frozen. Immutable documents (like ParsedJsonDocument are frozen once they are created, and there is no need to call freeze on them. Mutable documents (like JsonDocumentBuilder must be frozen before you can create a child document from one of its elements. Once a mutable document is frozen, any methods that would modify the document will throw.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue