Skip to content

ComplexValueBuilder.TryApply Method

Definition

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

TryApply(ref T)

Tries to apply an object instance value to the document.

public bool TryApply<T>(ref T value)
    where T : struct, IJsonElement<T>

Type Parameters

Parameter Description
T The type of the value.

Parameters

Name Type Description
value ref T The value to apply.

Returns

bool

true if the value was applied.

Remarks

If the value is a JSON object, its properties (if any) will be set on the current document, replacing any existing values if present, and the method returns true. Otherwise, no changes are made, and the method returns false.

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