Skip to content

JsonElement.CloneAsBuilder Method

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: JsonElement.cs

CloneAsBuilder(JsonWorkspace)

Creates a standalone copy of this element as a new document owned by workspace.

public JsonDocumentBuilder<JsonElement.Mutable> CloneAsBuilder(JsonWorkspace workspace)

Parameters

Name Type Description
workspace JsonWorkspace The workspace that will own the cloned document.

Returns

JsonDocumentBuilder<JsonElement.Mutable>

A workspace-owned builder containing the standalone copy.

Remarks

The returned document is fully independent of this element's source document and its backing storage (metadata and value bytes are copied), so the source document may be disposed without affecting the copy. The copy lives for the lifetime of workspace.

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