Class JsonValueExtensions

Namespace
Cratis.Json
Assembly
Cratis.Fundamentals.dll

Represents extension methods for JsonNode.

public static class JsonValueExtensions
Inheritance
JsonValueExtensions
Inherited Members

Fields

Noon

The value for midday.

public static readonly TimeOnly Noon

Field Value

TimeOnly

Methods

ToJsonValue(object?)

Convert any object to a JsonValue.

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "All JsonValue.Create<T> calls use well-known BCL types that are never trimmed.")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "All JsonValue.Create<T> calls use well-known BCL types that are safe for AOT.")]
public static JsonValue? ToJsonValue(this object? input)

Parameters

input object

Input value.

Returns

JsonValue

Converted JsonValue.

ToTargetTypeValue(JsonValue, Type)

Convert a JsonValue to a specific Type.

public static object? ToTargetTypeValue(this JsonValue value, Type targetType)

Parameters

value JsonValue

JsonValue to convert.

targetType Type

Type to convert to.

Returns

object

The converted type.