Skip to content

IMutableJsonDocument.FreezeElement Method

Definition

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

FreezeElement(int)

Creates a frozen (immutable) copy of the element at the specified index, backed by a new document builder registered in the same workspace.

public abstract TElement FreezeElement<TElement>(int index)
    where TElement : struct, IJsonElement<TElement>

Type Parameters

Parameter Description
TElement The immutable element type to return.

Parameters

Name Type Description
index int The index of the element to freeze.

Returns

TElement

An immutable element that lives for the lifetime of its workspace and its associated documents.

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