1 override of GetValue
System.Text.Json (1)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
23
public override T
GetValue
<T>()
198 references to GetValue
Aspire.Hosting.Azure.Tests (1)
AzureBicepProvisionerTests.cs (1)
65
Assert.Equal(20, parameters["age"]?["value"]?.
GetValue
<int>());
Aspire.Hosting.Redis.Tests (4)
RedisFunctionalTests.cs (4)
566
Assert.False(agreements["analytics"]!.
GetValue
<bool>());
567
Assert.False(agreements["notifications"]!.
GetValue
<bool>());
568
Assert.False(agreements["encryption"]!.
GetValue
<bool>());
569
Assert.True(agreements["eula"]!.
GetValue
<bool>());
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
450
if (propertyNodeType?.GetValueKind() == JsonValueKind.String && propertyNodeType.
GetValue
<string>() == "boolean")
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
85
var toRemove = signingKeys.SingleOrDefault(key => key["Issuer"].
GetValue
<string>() == issuer);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (22)
UserJwtsTests.cs (22)
113
Assert.Equal("dotnet-user-jwts", appSettings["Authentication"]["Schemes"]["Bearer"]["ValidIssuer"].
GetValue
<string>());
116
Assert.Equal("new-issuer", appSettings["Authentication"]["Schemes"]["Bearer"]["ValidIssuer"].
GetValue
<string>());
130
Assert.Equal("dotnet-user-jwts", appSettings["Authentication"]["Schemes"]["Bearer"]["ValidIssuer"].
GetValue
<string>());
133
Assert.Equal("new-issuer", appSettings["Authentication"]["Schemes"]["Bearer"]["ValidIssuer"].
GetValue
<string>());
304
Assert.Equal("baz", fooField["Bar"].
GetValue
<string>());
522
Assert.Equal(32, signingKey["Length"].
GetValue
<int>());
523
Assert.True(Convert.TryFromBase64String(signingKey["Value"].
GetValue
<string>(), new byte[32], out var _));
525
Assert.Equal("baz", fooField["Bar"].
GetValue
<string>());
550
Assert.Equal(32, signingKey["Length"].
GetValue
<int>());
551
Assert.True(Convert.TryFromBase64String(signingKey["Value"].
GetValue
<string>(), new byte[32], out var _));
553
Assert.Equal("baz", fooField["Bar"].
GetValue
<string>());
589
Assert.Equal(32, signingKey["Length"].
GetValue
<int>());
590
Assert.True(Convert.TryFromBase64String(signingKey["Value"].
GetValue
<string>(), new byte[32], out var _));
591
Assert.Equal("test-issuer", signingKey["Issuer"].
GetValue
<string>());
612
Assert.NotNull(signingKeys.SingleOrDefault(signingKey => signingKey["Issuer"].
GetValue
<string>() == "test-issuer"));
613
Assert.NotNull(signingKeys.SingleOrDefault(signingKey => signingKey["Issuer"].
GetValue
<string>() == "test-issuer-2"));
632
Assert.Equal("test-issuer", signingKey1["Issuer"].
GetValue
<string>());
633
Assert.Equal(32, signingKey1["Length"].
GetValue
<int>());
634
Assert.True(Convert.TryFromBase64String(signingKey1["Value"].
GetValue
<string>(), new byte[32], out var _));
636
Assert.Equal("test-issuer", signingKey2["Issuer"].
GetValue
<string>());
637
Assert.Equal(32, signingKey2["Length"].
GetValue
<int>());
638
Assert.True(Convert.TryFromBase64String(signingKey2["Value"].
GetValue
<string>(), new byte[32], out var _));
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
1391
Assert.Equal(nameof(JsonTodoChild), deserializedResponseBody["$type"]!.
GetValue
<string>());
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (1)
680
Assert.Equal(nameof(JsonTodoChild), node["$type"]!.
GetValue
<string>());
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (6)
JsonPatchDocumentJObjectTest.cs (6)
27
Assert.Equal("foo@baz.com", model.CustomData["Emails"][1].
GetValue
<string>());
58
Assert.Equal("Bar Baz", model.CustomData["Name"].
GetValue
<string>());
74
Assert.Equal("foo@bar.com", model.CustomData["UserName"].
GetValue
<string>());
107
Assert.Equal("Bar", model.CustomData["LastName"].
GetValue
<string>());
123
Assert.Equal("Foo", model.CustomData["Name"].
GetValue
<string>());
156
Assert.Equal("foo@baz.com", model.CustomData["Email"].
GetValue
<string>());
Microsoft.AspNetCore.OpenApi (1)
Extensions\JsonNodeSchemaExtensions.cs (1)
474
if (Enum.TryParse<JsonSchemaType>(jsonNode?.
GetValue
<string>(), true, out var openApiSchemaType))
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (29)
AdditionalTextsTests.Schemas.cs (14)
224
Assert.True(booleanTypeExample.
GetValue
<bool>());
227
Assert.Equal(42, integerTypeExample.
GetValue
<int>());
230
Assert.Equal(1234567890123456789, longTypeExample.
GetValue
<long>());
233
Assert.Equal(3.14, doubleTypeExample.
GetValue
<double>());
236
Assert.Equal(3.14f, floatTypeExample.
GetValue
<float>());
239
Assert.Equal(new DateTime(2022, 01, 01), dateTimeTypeExample.
GetValue
<DateTime>());
242
Assert.Equal("2022-01-01", dateOnlyTypeExample.
GetValue
<string>());
245
Assert.Equal("Hello, World!", stringTypeExample.
GetValue
<string>());
248
Assert.Equal("2d8f1eac-b5c6-4e29-8c62-4d9d75ef3d3d", guidTypeExample.
GetValue
<string>());
251
Assert.Equal(255, byteTypeExample.
GetValue
<int>());
254
Assert.Equal("12:30:45", timeOnlyTypeExample.
GetValue
<string>());
257
Assert.Equal("P3DT4H5M", timeSpanTypeExample.
GetValue
<string>());
260
Assert.Equal(3.14159265359m, decimalTypeExample.
GetValue
<decimal>());
263
Assert.Equal("https://example.com", uriTypeExample.
GetValue
<string>());
OperationTests.MinimalApis.cs (1)
269
Assert.Equal("johndoe", userExample["username"].
GetValue
<string>());
SchemaTests.cs (14)
216
Assert.True(booleanTypeExample.
GetValue
<bool>());
219
Assert.Equal(42, integerTypeExample.
GetValue
<int>());
222
Assert.Equal(1234567890123456789, longTypeExample.
GetValue
<long>());
225
Assert.Equal(3.14, doubleTypeExample.
GetValue
<double>());
228
Assert.Equal(3.14f, floatTypeExample.
GetValue
<float>());
231
Assert.Equal(new DateTime(2022, 01, 01), dateTimeTypeExample.
GetValue
<DateTime>());
234
Assert.Equal("2022-01-01", dateOnlyTypeExample.
GetValue
<string>());
237
Assert.Equal("Hello, World!", stringTypeExample.
GetValue
<string>());
240
Assert.Equal("2d8f1eac-b5c6-4e29-8c62-4d9d75ef3d3d", guidTypeExample.
GetValue
<string>());
243
Assert.Equal(255, byteTypeExample.
GetValue
<int>());
246
Assert.Equal("12:30:45", timeOnlyTypeExample.
GetValue
<string>());
249
Assert.Equal("P3DT4H5M", timeSpanTypeExample.
GetValue
<string>());
252
Assert.Equal(3.14159265359m, decimalTypeExample.
GetValue
<decimal>());
255
Assert.Equal("https://example.com", uriTypeExample.
GetValue
<string>());
Microsoft.AspNetCore.OpenApi.Tests (63)
Services\CreateSchemaReferenceIdTests.cs (2)
56
Assert.Equal("triangle", triangleSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
58
Assert.Equal("square", squareSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (21)
161
[(int id = 2) => { }, (JsonNode defaultValue) => Assert.Equal(2, defaultValue.
GetValue
<int>())],
162
[(float id = 3f) => { }, (JsonNode defaultValue) => Assert.Equal(3, defaultValue.
GetValue
<int>())],
163
[(string id = "test") => { }, (JsonNode defaultValue) => Assert.Equal("test", defaultValue.
GetValue
<string>())],
164
[(bool id = true) => { }, (JsonNode defaultValue) => Assert.True(defaultValue.
GetValue
<bool>())],
165
[(TaskStatus status = TaskStatus.Canceled) => { }, (JsonNode defaultValue) => Assert.Equal(6, defaultValue.
GetValue
<int>())],
167
[(Status status = Status.Pending) => { }, (JsonNode defaultValue) => Assert.Equal("Pending", defaultValue.
GetValue
<string>())],
168
[([DefaultValue(2)] int id) => { }, (JsonNode defaultValue) => Assert.Equal(2, defaultValue.
GetValue
<int>())],
169
[([DefaultValue(3f)] float id) => { }, (JsonNode defaultValue) => Assert.Equal(3, defaultValue.
GetValue
<int>())],
170
[([DefaultValue("test")] string id) => { }, (JsonNode defaultValue) => Assert.Equal("test", defaultValue.
GetValue
<string>())],
171
[([DefaultValue(true)] bool id) => { }, (JsonNode defaultValue) => Assert.True(defaultValue.
GetValue
<bool>())],
172
[([DefaultValue(TaskStatus.Canceled)] TaskStatus status) => { }, (JsonNode defaultValue) => Assert.Equal(6, defaultValue.
GetValue
<int>())],
173
[([DefaultValue(Status.Pending)] Status status) => { }, (JsonNode defaultValue) => Assert.Equal("Pending", defaultValue.
GetValue
<string>())],
175
[([DefaultValue(2)] int? id) => { }, (JsonNode defaultValue) => Assert.Equal(2, defaultValue.
GetValue
<int>())],
177
[([DefaultValue("foo")] string? id) => { }, (JsonNode defaultValue) => Assert.Equal("foo", defaultValue.
GetValue
<string>())],
179
[([DefaultValue(TaskStatus.Canceled)] TaskStatus? status) => { }, (JsonNode defaultValue) => Assert.Equal(6, defaultValue.
GetValue
<int>())],
242
Assert.Equal("Pending", value.
GetValue
<string>());
246
Assert.Equal("Approved", value.
GetValue
<string>());
250
Assert.Equal("Rejected", value.
GetValue
<string>());
633
Assert.Equal("Pending", value.
GetValue
<string>());
637
Assert.Equal("Approved", value.
GetValue
<string>());
641
Assert.Equal("Rejected", value.
GetValue
<string>());
Services\OpenApiSchemaService\OpenApiSchemaService.PolymorphicSchemas.cs (14)
43
Assert.Equal("triangle", triangleSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
45
Assert.Equal("square", squareSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
82
Assert.Equal(0, citySchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<int>());
86
Assert.Equal(1, timeSeriesSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<int>());
90
Assert.Equal(2, newsSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<int>());
125
Assert.Equal("student", citySchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
129
Assert.Equal("teacher", timeSeriesSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
161
Assert.Equal("paint", paintSchema.Properties["$type"].Enum.First().
GetValue
<string>());
165
Assert.Equal("fabric", fabricSchema.Properties["$type"].Enum.First().
GetValue
<string>());
213
Assert.Equal("dog", dogSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
217
Assert.Equal("cat", catSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
221
Assert.Equal("pet", petSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
294
Assert.Equal("manager", managerSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
296
Assert.Equal("employee", employeeSchema.Properties[schema.Discriminator.PropertyName].Enum.First().
GetValue
<string>());
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (1)
124
Assert.True(property.Value.Default.
GetValue
<bool>());
Services\OpenApiSchemaService\OpenApiSchemaService.ResponseSchemas.cs (2)
148
Assert.True(property.Value.Default.
GetValue
<bool>());
676
Assert.Equal(32, defaultValue.
GetValue
<int>());
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (1)
304
Assert.Equal("todo", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
Transformers\SchemaTransformerTests.cs (22)
166
Assert.Equal("1", ((JsonNodeExtension)schema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
175
Assert.Equal("2", ((JsonNodeExtension)schema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
203
Assert.Equal("1", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
206
Assert.Equal("1", ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
233
Assert.Equal("todo", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
256
Assert.Equal("1", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
259
Assert.Equal("1", ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
279
Assert.Equal("1", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
282
Assert.Equal("1", ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
306
value = ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>();
310
Assert.Equal(value, ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
317
Assert.Equal(value, ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
320
Assert.Equal(value, ((JsonNodeExtension)responseSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
521
Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)requestSchema.Extensions["x-my-extension"]).Node.
GetValue
<string>());
593
Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)triangleExtension).Node.
GetValue
<string>());
599
Assert.Equal("this-is-a-square", ((JsonNodeExtension)squareExtension).Node.
GetValue
<string>());
635
Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)triangleExtension).Node.
GetValue
<string>());
641
Assert.Equal("this-is-a-square", ((JsonNodeExtension)squareExtension).Node.
GetValue
<string>());
677
Assert.Equal("this-is-a-triangle", ((JsonNodeExtension)triangleExtension).Node.
GetValue
<string>());
683
Assert.Equal("this-is-a-square", ((JsonNodeExtension)squareExtension).Node.
GetValue
<string>());
755
Assert.True(((JsonNodeExtension)responseSchema.Not.Extensions["modified-by-not-schema-transformer"]).Node.
GetValue
<bool>());
761
Assert.True(((JsonNodeExtension)triangleSchema.Not.Extensions["modified-by-not-schema-transformer"]).Node.
GetValue
<bool>());
Microsoft.Extensions.AI.Abstractions (3)
Utilities\AIJsonUtilities.Schema.Create.cs (2)
262
string refUri = paramName!.
GetValue
<string>();
362
entry.
GetValue
<string>() is string type)
Utilities\AIJsonUtilities.Schema.Transform.cs (1)
180
string? description = schemaObj.TryGetPropertyValue(DescriptionPropertyName, out JsonNode? descriptionSchema) ? descriptionSchema?.
GetValue
<string>() : null;
Microsoft.ML.AutoML (9)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (2)
18
var schema = jValue["schema"].
GetValue
<string>();
19
var estimators = jValue["estimator"].
GetValue
<Dictionary<string, SweepableEstimator>>();
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (2)
19
var estimatorType = jsonObject["estimatorType"].
GetValue
<EstimatorType>();
20
var parameter = jsonObject["parameter"].
GetValue
<Parameter>();
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (2)
18
var parameter = jNode["parameter"].
GetValue
<Parameter>();
19
var estimators = jNode["estimators"].
GetValue
<SweepableEstimator[]>();
SweepableEstimator\Converter\SweepablePipelineConverter.cs (3)
18
var currentSchema = jValue["currentSchema"].
GetValue
<string>();
19
var schema = jValue["schema"].
GetValue
<string>();
20
var estimators = jValue["estimator"].
GetValue
<Dictionary<string, SweepableEstimator>>();
Microsoft.ML.AutoML.SourceGenerator (20)
SearchSpaceGenerator.cs (20)
39
var className = Utils.ToTitleCase(jNode["name"].
GetValue
<string>());
43
var optionName = Utils.ToTitleCase(t["name"].
GetValue
<string>());
44
string optionTypeName = t["type"].
GetValue
<string>() switch
69
(_, "string") => $"\"{defaultToken.
GetValue
<string>()}\"",
70
(_, "int") => $"{defaultToken.
GetValue
<int>().ToString(CultureInfo.InvariantCulture)}",
71
(_, "double") => $"{defaultToken.
GetValue
<double>().ToString(CultureInfo.InvariantCulture)}",
72
(_, "float") => $"{defaultToken.
GetValue
<float>().ToString(CultureInfo.InvariantCulture)}F",
73
(_, "bool") => defaultToken.
GetValue
<bool>() ? "true" : "false",
74
(_, "Anchor") => defaultToken.
GetValue
<string>(),
75
(_, "ResizingKind") => defaultToken.
GetValue
<string>(),
76
(_, "ColorBits") => defaultToken.
GetValue
<string>(),
77
(_, "ColorsOrder") => defaultToken.
GetValue
<string>(),
78
(_, "BertArchitecture") => defaultToken.
GetValue
<string>(),
79
(_, "Microsoft.ML.Vision.ImageClassificationTrainer.Architecture") => defaultToken.
GetValue
<string>(),
80
(_, "Microsoft.ML.Data.DataKind") => defaultToken.
GetValue
<string>(),
81
(_, "Microsoft.ML.IDataView") => defaultToken.
GetValue
<string>(),
82
(_, "Microsoft.ML.Transforms.Text.TextNormalizingEstimator.CaseMode") => defaultToken.
GetValue
<string>(),
97
var minValue = searchSpaceNode["min"].
GetValue
<double>();
98
var maxValue = searchSpaceNode["max"].
GetValue
<double>();
99
var logBase = searchSpaceObject.ContainsKey("log_base") is false ? "false" : searchSpaceNode["log_base"].
GetValue
<bool>() ? "true" : "false";
System.Text.Json (36)
System\Text\Json\Nodes\JsonArray.cs (2)
137
/// Returns an enumerable that wraps calls to <see cref="JsonNode.
GetValue
{T}"/>.
145
yield return item is null ? (T)(object?)null! : item.
GetValue
<T>();
System\Text\Json\Nodes\JsonNode.Operators.cs (33)
255
public static explicit operator bool(JsonNode value) => value.
GetValue
<bool>();
262
public static explicit operator bool?(JsonNode? value) => value?.
GetValue
<bool>();
269
public static explicit operator byte(JsonNode value) => value.
GetValue
<byte>();
276
public static explicit operator byte?(JsonNode? value) => value?.
GetValue
<byte>();
283
public static explicit operator char(JsonNode value) => value.
GetValue
<char>();
290
public static explicit operator char?(JsonNode? value) => value?.
GetValue
<char>();
297
public static explicit operator DateTime(JsonNode value) => value.
GetValue
<DateTime>();
304
public static explicit operator DateTime?(JsonNode? value) => value?.
GetValue
<DateTime>();
311
public static explicit operator DateTimeOffset(JsonNode value) => value.
GetValue
<DateTimeOffset>();
318
public static explicit operator DateTimeOffset?(JsonNode? value) => value?.
GetValue
<DateTimeOffset>();
325
public static explicit operator decimal(JsonNode value) => value.
GetValue
<decimal>();
332
public static explicit operator decimal?(JsonNode? value) => value?.
GetValue
<decimal>();
339
public static explicit operator double(JsonNode value) => value.
GetValue
<double>();
346
public static explicit operator double?(JsonNode? value) => value?.
GetValue
<double>();
353
public static explicit operator Guid(JsonNode value) => value.
GetValue
<Guid>();
360
public static explicit operator Guid?(JsonNode? value) => value?.
GetValue
<Guid>();
367
public static explicit operator short(JsonNode value) => value.
GetValue
<short>();
374
public static explicit operator short?(JsonNode? value) => value?.
GetValue
<short>();
381
public static explicit operator int(JsonNode value) => value.
GetValue
<int>();
388
public static explicit operator int?(JsonNode? value) => value?.
GetValue
<int>();
395
public static explicit operator long(JsonNode value) => value.
GetValue
<long>();
402
public static explicit operator long?(JsonNode? value) => value?.
GetValue
<long>();
410
public static explicit operator sbyte(JsonNode value) => value.
GetValue
<sbyte>();
418
public static explicit operator sbyte?(JsonNode? value) => value?.
GetValue
<sbyte>();
425
public static explicit operator float(JsonNode value) => value.
GetValue
<float>();
432
public static explicit operator float?(JsonNode? value) => value?.
GetValue
<float>();
439
public static explicit operator string?(JsonNode? value) => value?.
GetValue
<string>();
447
public static explicit operator ushort(JsonNode value) => value.
GetValue
<ushort>();
455
public static explicit operator ushort?(JsonNode? value) => value?.
GetValue
<ushort>();
463
public static explicit operator uint(JsonNode value) => value.
GetValue
<uint>();
471
public static explicit operator uint?(JsonNode? value) => value?.
GetValue
<uint>();
479
public static explicit operator ulong(JsonNode value) => value.
GetValue
<ulong>();
487
public static explicit operator ulong?(JsonNode? value) => value?.
GetValue
<ulong>();
System\Text\Json\Nodes\JsonValue.cs (1)
32
/// <seealso cref="JsonNode.
GetValue
{T}"></seealso>