1 type derived from JsonValue
System.Text.Json (1)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
11internal abstract class JsonValue<TValue> : JsonValue
253 references to JsonValue
Aspire.Dashboard (5)
Otlp\Model\OtlpHelpers.cs (5)
115AnyValue.ValueOneofCase.StringValue => JsonValue.Create(value.StringValue), 116AnyValue.ValueOneofCase.IntValue => JsonValue.Create(value.IntValue), 117AnyValue.ValueOneofCase.DoubleValue => JsonValue.Create(value.DoubleValue), 118AnyValue.ValueOneofCase.BoolValue => JsonValue.Create(value.BoolValue), 119AnyValue.ValueOneofCase.BytesValue => JsonValue.Create(value.BytesValue.ToHexString()),
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\BicepProvisioner.cs (1)
500IEnumerable<string> s => new JsonArray(s.Select(s => JsonValue.Create(s)).ToArray()),
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
738public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert) && typeToConvert != typeof(JsonValue);
dotnet-user-jwts (2)
Helpers\JwtAuthenticationSchemeSettings.cs (1)
24[nameof(TokenValidationParameters.ValidAudiences)] = new JsonArray(Audiences.Select(aud => JsonValue.Create(aud)).ToArray()),
Helpers\SigningKeysHandler.cs (1)
92secrets.Add(signkingKeysPropertyName, JsonValue.Create(new[] { key }));
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
223_ => JsonValue.Create(element)
Microsoft.Extensions.AI.Abstractions.Tests (3)
test\Shared\JsonSchemaExporter\TestTypes.cs (3)
103yield return new TestData<JsonValue>((JsonValue)42, "true"); 1228[JsonSerializable(typeof(JsonValue))]
Microsoft.ML.AutoML (9)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (2)
17var jValue = JsonValue.Parse(ref reader); 28jsonObject["estimators"] = JsonValue.Create(value.Estimators);
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (3)
18var jsonObject = JsonValue.Parse(ref reader); 30jObject["estimatorType"] = JsonValue.Create(value.EstimatorType); 31jObject["parameter"] = JsonValue.Create(value.Parameter);
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (2)
30jNode["parameter"] = JsonValue.Create(parameter); 31jNode["estimators"] = JsonValue.Create(estimators);
SweepableEstimator\Converter\SweepablePipelineConverter.cs (2)
17var jValue = JsonValue.Parse(ref reader); 30jsonObject["estimators"] = JsonValue.Create(value.Estimators);
Shared (1)
JsonSchemaExporter\JsonSchemaExporter.cs (1)
631[typeof(JsonValue)] = _ => JsonSchema.CreateTrueSchema(),
Shared.Tests (7)
JsonSchemaExporter\JsonSchemaExporterTests.cs (4)
61JsonValue type = Assert.IsAssignableFrom<JsonValue>(schema["type"]); 77JsonValue value = Assert.IsAssignableFrom<JsonValue>(schema["type"]);
JsonSchemaExporter\TestTypes.cs (3)
103yield return new TestData<JsonValue>((JsonValue)42, "true"); 1228[JsonSerializable(typeof(JsonValue))]
System.Text.Json (223)
System\Text\Json\Nodes\JsonArray.cs (5)
104case JsonValue value: 139/// <typeparam name="T">The type of the value to obtain from the <see cref="JsonValue"/>.</typeparam> 216[RequiresUnreferencedCode(JsonValue.CreateUnreferencedCodeMessage)] 217[RequiresDynamicCode(JsonValue.CreateDynamicCodeMessage)] 391if (Value is JsonValue)
System\Text\Json\Nodes\JsonNode.cs (18)
95/// Casts to the derived <see cref="JsonValue"/> type. 98/// A <see cref="JsonValue"/>. 101/// The node is not a <see cref="JsonValue"/>. 103public JsonValue AsValue() 105JsonValue? jValue = this as JsonValue; 109ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonValue)); 177/// Gets the value for the current <see cref="JsonValue"/>. 179/// <typeparam name="T">The type of the value to obtain from the <see cref="JsonValue"/>.</typeparam> 180/// <returns>A value converted from the <see cref="JsonValue"/> instance.</returns> 186/// The underlying value of a <see cref="JsonValue"/> after deserialization is an instance of <see cref="JsonElement"/>, 187/// otherwise it's the value specified when the <see cref="JsonValue"/> was created. 189/// <seealso cref="System.Text.Json.Nodes.JsonValue.TryGetValue"></seealso> 194/// The current <see cref="JsonNode"/> is not a <see cref="JsonValue"/> or 198throw new InvalidOperationException(SR.Format(SR.NodeWrongType, nameof(JsonValue))); 326[RequiresUnreferencedCode(JsonValue.CreateUnreferencedCodeMessage)] 327[RequiresDynamicCode(JsonValue.CreateDynamicCodeMessage)] 390return JsonValue.CreateFromTypeInfo(value, jsonTypeInfo, options);
System\Text\Json\Nodes\JsonNode.Operators.cs (33)
15public static implicit operator JsonNode(bool value) => JsonValue.Create(value); 22public static implicit operator JsonNode?(bool? value) => JsonValue.Create(value); 29public static implicit operator JsonNode(byte value) => JsonValue.Create(value); 36public static implicit operator JsonNode?(byte? value) => JsonValue.Create(value); 43public static implicit operator JsonNode(char value) => JsonValue.Create(value); 50public static implicit operator JsonNode?(char? value) => JsonValue.Create(value); 57public static implicit operator JsonNode(DateTime value) => JsonValue.Create(value); 64public static implicit operator JsonNode?(DateTime? value) => JsonValue.Create(value); 71public static implicit operator JsonNode(DateTimeOffset value) => JsonValue.Create(value); 78public static implicit operator JsonNode?(DateTimeOffset? value) => JsonValue.Create(value); 85public static implicit operator JsonNode(decimal value) => JsonValue.Create(value); 92public static implicit operator JsonNode?(decimal? value) => JsonValue.Create(value); 99public static implicit operator JsonNode(double value) => JsonValue.Create(value); 106public static implicit operator JsonNode?(double? value) => JsonValue.Create(value); 113public static implicit operator JsonNode(Guid value) => JsonValue.Create(value); 120public static implicit operator JsonNode?(Guid? value) => JsonValue.Create(value); 127public static implicit operator JsonNode(short value) => JsonValue.Create(value); 134public static implicit operator JsonNode?(short? value) => JsonValue.Create(value); 141public static implicit operator JsonNode(int value) => JsonValue.Create(value); 148public static implicit operator JsonNode?(int? value) => JsonValue.Create(value); 155public static implicit operator JsonNode(long value) => JsonValue.Create(value); 162public static implicit operator JsonNode?(long? value) => JsonValue.Create(value); 170public static implicit operator JsonNode(sbyte value) => JsonValue.Create(value); 178public static implicit operator JsonNode?(sbyte? value) => JsonValue.Create(value); 185public static implicit operator JsonNode(float value) => JsonValue.Create(value); 192public static implicit operator JsonNode?(float? value) => JsonValue.Create(value); 200public static implicit operator JsonNode?(string? value) => JsonValue.Create(value); 208public static implicit operator JsonNode(ushort value) => JsonValue.Create(value); 216public static implicit operator JsonNode?(ushort? value) => JsonValue.Create(value); 224public static implicit operator JsonNode(uint value) => JsonValue.Create(value); 232public static implicit operator JsonNode?(uint? value) => JsonValue.Create(value); 240public static implicit operator JsonNode(ulong value) => JsonValue.Create(value); 248public static implicit operator JsonNode?(ulong? value) => JsonValue.Create(value);
System\Text\Json\Nodes\JsonNode.To.cs (1)
45if (this is JsonValue)
System\Text\Json\Nodes\JsonObject.cs (2)
176case JsonValue value: 352if (Value is JsonValue)
System\Text\Json\Nodes\JsonValue.CreateOverloads.cs (142)
12/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 14/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 16/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 17public static JsonValue Create(bool value, JsonNodeOptions? options = null) => new JsonValuePrimitive<bool>(value, JsonMetadataServices.BooleanConverter, options); 20/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 22/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 24/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 25public static JsonValue? Create(bool? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<bool>(value.Value, JsonMetadataServices.BooleanConverter, options) : null; 28/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 30/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 32/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 33public static JsonValue Create(byte value, JsonNodeOptions? options = null) => new JsonValuePrimitive<byte>(value, JsonMetadataServices.ByteConverter, options); 36/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 38/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 40/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 41public static JsonValue? Create(byte? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<byte>(value.Value, JsonMetadataServices.ByteConverter, options) : null; 44/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 46/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 48/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 49public static JsonValue Create(char value, JsonNodeOptions? options = null) => new JsonValuePrimitive<char>(value, JsonMetadataServices.CharConverter, options); 52/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 54/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 56/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 57public static JsonValue? Create(char? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<char>(value.Value, JsonMetadataServices.CharConverter, options) : null; 60/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 62/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 64/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 65public static JsonValue Create(DateTime value, JsonNodeOptions? options = null) => new JsonValuePrimitive<DateTime>(value, JsonMetadataServices.DateTimeConverter, options); 68/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 70/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 72/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 73public static JsonValue? Create(DateTime? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<DateTime>(value.Value, JsonMetadataServices.DateTimeConverter, options) : null; 76/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 78/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 80/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 81public static JsonValue Create(DateTimeOffset value, JsonNodeOptions? options = null) => new JsonValuePrimitive<DateTimeOffset>(value, JsonMetadataServices.DateTimeOffsetConverter, options); 84/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 86/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 88/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 89public static JsonValue? Create(DateTimeOffset? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<DateTimeOffset>(value.Value, JsonMetadataServices.DateTimeOffsetConverter, options) : null; 92/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 94/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 96/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 97public static JsonValue Create(decimal value, JsonNodeOptions? options = null) => new JsonValuePrimitive<decimal>(value, JsonMetadataServices.DecimalConverter, options); 100/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 102/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 104/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 105public static JsonValue? Create(decimal? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<decimal>(value.Value, JsonMetadataServices.DecimalConverter, options) : null; 108/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 110/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 112/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 113public static JsonValue Create(double value, JsonNodeOptions? options = null) => new JsonValuePrimitive<double>(value, JsonMetadataServices.DoubleConverter, options); 116/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 118/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 120/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 121public static JsonValue? Create(double? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<double>(value.Value, JsonMetadataServices.DoubleConverter, options) : null; 124/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 126/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 128/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 129public static JsonValue Create(Guid value, JsonNodeOptions? options = null) => new JsonValuePrimitive<Guid>(value, JsonMetadataServices.GuidConverter, options); 132/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 134/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 136/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 137public static JsonValue? Create(Guid? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<Guid>(value.Value, JsonMetadataServices.GuidConverter, options) : null; 140/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 142/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 144/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 145public static JsonValue Create(short value, JsonNodeOptions? options = null) => new JsonValuePrimitive<short>(value, JsonMetadataServices.Int16Converter, options); 148/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 150/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 152/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 153public static JsonValue? Create(short? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<short>(value.Value, JsonMetadataServices.Int16Converter, options) : null; 156/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 158/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 160/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 161public static JsonValue Create(int value, JsonNodeOptions? options = null) => new JsonValuePrimitive<int>(value, JsonMetadataServices.Int32Converter, options); 164/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 166/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 168/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 169public static JsonValue? Create(int? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<int>(value.Value, JsonMetadataServices.Int32Converter, options) : null; 172/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 174/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 176/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 177public static JsonValue Create(long value, JsonNodeOptions? options = null) => new JsonValuePrimitive<long>(value, JsonMetadataServices.Int64Converter, options); 180/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 182/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 184/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 185public static JsonValue? Create(long? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<long>(value.Value, JsonMetadataServices.Int64Converter, options) : null; 188/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 190/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 192/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 194public static JsonValue Create(sbyte value, JsonNodeOptions? options = null) => new JsonValuePrimitive<sbyte>(value, JsonMetadataServices.SByteConverter, options); 197/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 199/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 201/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 203public static JsonValue? Create(sbyte? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<sbyte>(value.Value, JsonMetadataServices.SByteConverter, options) : null; 206/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 208/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 210/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 211public static JsonValue Create(float value, JsonNodeOptions? options = null) => new JsonValuePrimitive<float>(value, JsonMetadataServices.SingleConverter, options); 214/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 216/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 218/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 219public static JsonValue? Create(float? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<float>(value.Value, JsonMetadataServices.SingleConverter, options) : null; 222/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 224/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 226/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 228public static JsonValue? Create(string? value, JsonNodeOptions? options = null) => value != null ? new JsonValuePrimitive<string>(value, JsonMetadataServices.StringConverter!, options) : null; 231/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 233/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 235/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 237public static JsonValue Create(ushort value, JsonNodeOptions? options = null) => new JsonValuePrimitive<ushort>(value, JsonMetadataServices.UInt16Converter, options); 240/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 242/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 244/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 246public static JsonValue? Create(ushort? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<ushort>(value.Value, JsonMetadataServices.UInt16Converter, options) : null; 249/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 251/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 253/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 255public static JsonValue Create(uint value, JsonNodeOptions? options = null) => new JsonValuePrimitive<uint>(value, JsonMetadataServices.UInt32Converter, options); 258/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 260/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 262/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 264public static JsonValue? Create(uint? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<uint>(value.Value, JsonMetadataServices.UInt32Converter, options) : null; 267/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 269/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 271/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 273public static JsonValue Create(ulong value, JsonNodeOptions? options = null) => new JsonValuePrimitive<ulong>(value, JsonMetadataServices.UInt64Converter, options); 276/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 278/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 280/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 282public static JsonValue? Create(ulong? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<ulong>(value.Value, JsonMetadataServices.UInt64Converter, options) : null; 285/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 287/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 289/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 290public static JsonValue? Create(JsonElement value, JsonNodeOptions? options = null) => JsonValue.CreateFromElement(ref value, options); 293/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 295/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 297/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 298public static JsonValue? Create(JsonElement? value, JsonNodeOptions? options = null) => value is JsonElement element ? JsonValue.CreateFromElement(ref element, options) : null;
System\Text\Json\Nodes\JsonValue.cs (12)
29/// The underlying value of a <see cref="JsonValue"/> after deserialization is an instance of <see cref="JsonElement"/>, 30/// otherwise it's the value specified when the <see cref="JsonValue"/> was created. 39/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 42/// The new instance of the <see cref="JsonValue"/> class that contains the specified value. 47/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 50public static JsonValue? Create<T>(T? value, JsonNodeOptions? options = null) 72/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 75/// The new instance of the <see cref="JsonValue"/> class that contains the specified value. 81/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 82public static JsonValue? Create<T>(T? value, JsonTypeInfo<T> jsonTypeInfo, JsonNodeOptions? options = null) 164internal static JsonValue CreateFromTypeInfo<T>(T value, JsonTypeInfo<T> jsonTypeInfo, JsonNodeOptions? options = null) 181internal static JsonValue? CreateFromElement(ref readonly JsonElement element, JsonNodeOptions? options = null)
System\Text\Json\Nodes\JsonValueOfElement.cs (1)
30if (otherNode is JsonValue)
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (1)
32if (otherNode is JsonValue otherValue && otherValue.TryGetValue(out TValue? v))
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
14if (typeof(JsonValue).IsAssignableFrom(typeToConvert))
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (4)
10internal sealed class JsonValueConverter : JsonConverter<JsonValue?> 12public override void Write(Utf8JsonWriter writer, JsonValue? value, JsonSerializerOptions options) 23public override JsonValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 31return JsonValue.CreateFromElement(ref element, options.GetNodeOptions());
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
465if (jsonNode is JsonValue jsonValue &&
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (2)
160public static JsonConverter<JsonValue?> JsonValueConverter => s_jsonValueConverter ??= new JsonValueConverter(); 161private static JsonConverter<JsonValue?>? s_jsonValueConverter;