151 references to RootElement
Aspire.Hosting.PostgreSQL.Tests (1)
AddPostgresTests.cs (1)
473var servers = document.RootElement.GetProperty("Servers");
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
464var packageVersionsElement = packageVersionDocument.RootElement.GetProperty("Packages");
dotnet-user-jwts (2)
Helpers\DevJwtCliHelpers.cs (2)
84if (ExtractIISExpressUrlFromProfile(launchSettingsJson.RootElement) is { } iisUrls) 89if (launchSettingsJson.RootElement.TryGetProperty("profiles", out var profiles))
JwtBearerSample (1)
Startup.cs (1)
79var obj = json.RootElement;
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookHandler.cs (1)
60var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
58var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
54var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.OAuth (3)
OAuthHandler.cs (1)
256var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, user.RootElement);
OAuthTokenResponse.cs (2)
21var root = response.RootElement; 95var root = response.RootElement;
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
OpenIdConnectHandler.cs (2)
921action.Run(payload.RootElement, identity, ClaimsIssuer); 1101action.Run(updatedUser.RootElement, identity, ClaimsIssuer);
Microsoft.AspNetCore.Authentication.Test (18)
ClaimActionTests.cs (7)
20action.Run(userData.RootElement, identity, "iss"); 34action.Run(userData.RootElement, identity, "iss"); 52action.Run(userData.RootElement, identity, "iss"); 66action.Run(userData.RootElement, identity, "iss"); 83action.Run(userData.RootElement, identity, "iss"); 100action.Run(userData.RootElement, identity, "iss"); 115action.Run(userData.RootElement, identity, "iss");
JsonDocumentAuthExtensionsTests.cs (1)
20var value = document.RootElement.GetString("foo");
JwtBearerTests.cs (4)
957Assert.Equal(token.ValidTo, dom.RootElement.GetProperty("expires").GetDateTimeOffset()); 958Assert.Equal(token.ValidFrom, dom.RootElement.GetProperty("issued").GetDateTimeOffset()); 999Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind); 1001var expiresElement = dom.RootElement.GetProperty("expires");
JwtBearerTests_Handler.cs (4)
901Assert.Equal(token.ValidTo, dom.RootElement.GetProperty("expires").GetDateTimeOffset()); 902Assert.Equal(token.ValidFrom, dom.RootElement.GetProperty("issued").GetDateTimeOffset()); 942Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind); 944var expiresElement = dom.RootElement.GetProperty("expires");
OpenIdConnect\UniqueJsonKeyClaimActionTests.cs (2)
20action.Run(userData.RootElement, identity, "iss"); 37action.Run(userData.RootElement, identity, "iss");
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
136var ticket = await CreateTicketAsync(identity, properties, accessToken, user.RootElement);
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
TargetPickerUi.cs (1)
148var res = System.Text.Json.JsonDocument.Parse(await ReceiveMessageLoop(browserDebugClientConnect, token)).RootElement;
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\Json\AnyConverter.cs (3)
24if (!d.RootElement.TryGetProperty(AnyTypeUrlField, out var urlField)) 45if (!d.RootElement.TryGetProperty(AnyWellKnownTypeValueField, out var valueField)) 54data = (IMessage)JsonSerializer.Deserialize(d.RootElement, descriptor.ClrType, options)!;
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (47)
ConverterTests\JsonConverterWriteTests.cs (2)
550Assert.True(comparer.Equals(doc1.RootElement, doc2.RootElement));
ServerStreamingServerCallHandlerTests.cs (10)
68Assert.Equal("Hello TestName! 1", responseJson1.RootElement.GetProperty("message").GetString()); 75Assert.Equal("Hello TestName! 2", responseJson2.RootElement.GetProperty("message").GetString()); 112Assert.Equal("Hello TestName! 1", responseJson1.RootElement.GetProperty("message").GetString()); 116Assert.Equal("Exception was thrown by handler.", responseJson2.RootElement.GetProperty("message").GetString()); 117Assert.Equal(2, responseJson2.RootElement.GetProperty("code").GetInt32()); 154Assert.Equal("Hello TestName! 1", responseJson1.RootElement.GetProperty("message").GetString()); 158Assert.Equal("Detail!", responseJson2.RootElement.GetProperty("message").GetString()); 159Assert.Equal((int)StatusCode.Aborted, responseJson2.RootElement.GetProperty("code").GetInt32()); 195Assert.Equal("Exception was thrown by handler. Exception: Exception!", responseJson.RootElement.GetProperty("message").GetString()); 196Assert.Equal(2, responseJson.RootElement.GetProperty("code").GetInt32());
UnaryServerCallHandlerTests.cs (35)
82Assert.Equal("Hello TestName!", responseJson.RootElement.GetProperty("message").GetString()); 120Assert.Equal(name, responseJson.RootElement.GetString()); 180Assert.Equal(JsonValueKind.Array, responseJson.RootElement.ValueKind); 181Assert.Equal("One", responseJson.RootElement[0].GetString()); 182Assert.Equal("Two", responseJson.RootElement[1].GetString()); 183Assert.Equal("", responseJson.RootElement[2].GetString()); 717Assert.Equal("", responseJson.RootElement.GetProperty("message").GetString()); 749Assert.Equal(expectedError, responseJson.RootElement.GetProperty("message").GetString()); 750Assert.Equal((int)StatusCode.InvalidArgument, responseJson.RootElement.GetProperty("code").GetInt32()); 787Assert.Equal(expectedError, responseJson.RootElement.GetProperty("message").GetString()); 788Assert.Equal((int)StatusCode.InvalidArgument, responseJson.RootElement.GetProperty("code").GetInt32()); 817Assert.Equal(expectedError, responseJson.RootElement.GetProperty("message").GetString()); 818Assert.Equal((int)StatusCode.InvalidArgument, responseJson.RootElement.GetProperty("code").GetInt32()); 841Assert.Equal("Detail!", responseJson.RootElement.GetProperty("message").GetString()); 842Assert.Equal((int)StatusCode.Unauthenticated, responseJson.RootElement.GetProperty("code").GetInt32()); 866Assert.Equal("Detail!", responseJson.RootElement.GetProperty("message").GetString()); 867Assert.Equal((int)StatusCode.Unauthenticated, responseJson.RootElement.GetProperty("code").GetInt32()); 933Assert.Equal(123, responseJson.RootElement.GetProperty("code").GetInt32()); 934Assert.Equal("This is a message", responseJson.RootElement.GetProperty("message").GetString()); 936var details = responseJson.RootElement.GetProperty("details").EnumerateArray().ToArray(); 1011Assert.Equal(123, responseJson.RootElement.GetProperty("code").GetInt32()); 1012Assert.Equal("This is a message", responseJson.RootElement.GetProperty("message").GetString()); 1014var details = responseJson.RootElement.GetProperty("details").EnumerateArray().ToArray(); 1053Assert.Equal("Exception was thrown by handler.", responseJson.RootElement.GetProperty("message").GetString()); 1054Assert.Equal((int)StatusCode.Unknown, responseJson.RootElement.GetProperty("code").GetInt32()); 1083Assert.Equal("Exception was thrown by handler. InvalidOperationException: Error!", responseJson.RootElement.GetProperty("message").GetString()); 1084Assert.Equal((int)StatusCode.Unknown, responseJson.RootElement.GetProperty("code").GetInt32()); 1112Assert.Equal(@"Detail!", responseJson.RootElement.GetProperty("message").GetString()); 1113Assert.Equal((int)StatusCode.Unauthenticated, responseJson.RootElement.GetProperty("code").GetInt32()); 1155Assert.Equal(@"Hello World!", responseJson.RootElement.GetProperty("message").GetString()); 1209Assert.Equal($"Hello {requestContent.Length}!", responseJson.RootElement.GetProperty("message").GetString()); 1236Assert.Equal("Unable to deserialize null to Int32Value.", responseJson.RootElement.GetProperty("message").GetString()); 1475Assert.Equal("Exception was thrown by handler.", responseJson.RootElement.GetProperty("message").GetString()); 1476Assert.Equal((int)StatusCode.Unknown, responseJson.RootElement.GetProperty("code").GetInt32()); 1737var anyMessage = responseJson.RootElement.GetProperty("anyMessage");
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
HttpValidationProblemDetailsJsonConverterTest.cs (7)
35Assert.Equal(problemDetails.Type, document.RootElement.GetProperty("type").GetString()); 36Assert.Equal(problemDetails.Title, document.RootElement.GetProperty("title").GetString()); 37Assert.Equal(problemDetails.Status, document.RootElement.GetProperty("status").GetInt32()); 38Assert.Equal(problemDetails.Detail, document.RootElement.GetProperty("detail").GetString()); 39Assert.Equal(problemDetails.Instance, document.RootElement.GetProperty("instance").GetString()); 40Assert.Equal((string)problemDetails.Extensions["traceId"]!, document.RootElement.GetProperty("traceId").GetString()); 41var errorsElement = document.RootElement.GetProperty("errors");
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Infrastructure\DefaultTempDataSerializer.cs (1)
21var rootElement = jsonDocument.RootElement;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
HttpsTests.cs (1)
162var result = System.Text.Json.JsonDocument.Parse(response).RootElement;
Microsoft.Build (1)
Construction\Solution\SolutionFile.cs (1)
660solution = text.RootElement.GetProperty("solution");
Microsoft.CodeAnalysis.Features (1)
PdbSourceDocument\SourceLinkMap.cs (1)
72var root = JsonDocument.Parse(json, new JsonDocumentOptions() { AllowTrailingCommas = true }).RootElement;
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Protocol\Converters\ParameterInformationConverter.cs (1)
19var root = document.RootElement;
Protocol\Converters\SumConverter.cs (1)
206if (document.RootElement.TryGetProperty(kindAttribute.KindPropertyName, out var value))
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (1)
19var data = JsonDocument.ParseValue(ref reader).RootElement;
Protocol\Internal\Converters\ImageIdConverter.cs (1)
20var root = document.RootElement;
Protocol\Internal\Converters\ObjectContentConverter.cs (1)
49var data = jsonDocument.RootElement;
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\MSBuildProjectLoader.SolutionFilterReader.cs (1)
28var solution = document.RootElement.GetProperty("solution");
Microsoft.DotNet.Arcade.Sdk (1)
src\InstallDotNetCore.cs (1)
61if (jsonDocument.RootElement.TryGetProperty("tools", out JsonElement toolsElement))
Microsoft.Extensions.AI (1)
ChatCompletion\ChatCompletion{T}.cs (1)
145if (JsonDocument.Parse(json!).RootElement.TryGetProperty("data", out var data))
Microsoft.Extensions.AI.Abstractions.Tests (8)
ChatCompletion\ChatResponseFormatTests.cs (1)
12private static JsonElement EmptySchema => JsonDocument.Parse("{}").RootElement;
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
101yield return new TestData<JsonElement>(JsonDocument.Parse("""[{ "x" : 42 }]""").RootElement, "true"); 117yield return new TestData<JsonElement?>(JsonDocument.Parse("{}").RootElement, "true");
Utilities\AIJsonUtilitiesTests.cs (5)
75""").RootElement; 106""").RootElement; 151""").RootElement; 193""").RootElement; 234""").RootElement;
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
28private static readonly JsonElement _defaultParameterSchema = JsonDocument.Parse("{}").RootElement;
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
25private static readonly JsonElement _defaultParameterSchema = JsonDocument.Parse("{}").RootElement; 26private static readonly JsonElement _schemalessJsonResponseFormatValue = JsonDocument.Parse("\"json\"").RootElement;
Microsoft.Extensions.AI.OpenAI (3)
OpenAIModelMapper.ChatCompletion.cs (2)
24private static readonly JsonElement _defaultParameterSchema = JsonDocument.Parse("{}").RootElement; 209JsonElement jsonElement = toolChoiceJson.RootElement;
OpenAIRealtimeExtensions.cs (1)
21private static readonly JsonElement _defaultParameterSchema = JsonDocument.Parse("{}").RootElement;
Microsoft.Extensions.Configuration.Json (3)
JsonConfigurationFileParser.cs (3)
33if (doc.RootElement.ValueKind != JsonValueKind.Object) 35throw new FormatException(SR.Format(SR.Error_InvalidTopLevelJSONElement, doc.RootElement.ValueKind)); 37VisitObjectElement(doc.RootElement);
Microsoft.JSInterop.Tests (1)
Infrastructure\DotNetDispatcherTest.cs (1)
131var root = result.RootElement;
Negotiate.Client (2)
Controllers\AuthTestController.cs (2)
284var details = JsonDocument.Parse(body).RootElement; 304var details = JsonDocument.Parse(body).RootElement;
OpenIdConnectSample (4)
Startup.cs (4)
267props.UpdateTokenValue("access_token", payload.RootElement.GetString("access_token")); 268props.UpdateTokenValue("refresh_token", payload.RootElement.GetString("refresh_token")); 269if (payload.RootElement.TryGetProperty("expires_in", out var property) && int.TryParse(property.GetString(), out var seconds)) 286await res.WriteAsync(HtmlEncoder.Default.Encode(payload.RootElement.ToString()).Replace(",", ",<br>") + "<br>");
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
101yield return new TestData<JsonElement>(JsonDocument.Parse("""[{ "x" : 42 }]""").RootElement, "true"); 117yield return new TestData<JsonElement?>(JsonDocument.Parse("{}").RootElement, "true");
SocialSample (8)
Startup.cs (8)
146context.RunClaimActions(user.RootElement); 207context.RunClaimActions(user.RootElement); 337authProperties.UpdateTokenValue("access_token", payload.RootElement.GetString("access_token")); 338refreshToken = payload.RootElement.GetString("refresh_token"); 343if (payload.RootElement.TryGetProperty("expires_in", out var property) && property.TryGetInt32(out var seconds)) 372authProperties.UpdateTokenValue("access_token", payload.RootElement.GetString("access_token")); 373if (payload.RootElement.TryGetProperty("expires_in", out var property) && property.TryGetInt32(out var seconds)) 495await response.WriteAsync(HtmlEncoder.Default.Encode(payload.RootElement.ToString()).Replace(",", ",<br>") + "<br>");
System.Text.Json (10)
System\Text\Json\Document\JsonDocument.cs (3)
99/// This <see cref="RootElement"/>'s <see cref="JsonElement.ValueKind"/> would result in an invalid JSON. 111RootElement.WriteTo(writer); 793return newDocument.RootElement;
System\Text\Json\Document\JsonElement.Parse.cs (5)
53return document.RootElement; 59return document.RootElement; 65return document.RootElement; 71return document.RootElement; 115element = document?.RootElement;
System\Text\Json\Nodes\JsonNode.Parse.cs (1)
158return JsonNodeConverter.Create(document.RootElement, nodeOptions);
System\Text\Json\Nodes\JsonValue.cs (1)
148return backingDocument.RootElement;
Templates.Blazor.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
321var profiles = launchSettings.RootElement.GetProperty("profiles");
Templates.Blazor.WebAssembly.Auth.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
321var profiles = launchSettings.RootElement.GetProperty("profiles");
Templates.Blazor.WebAssembly.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
321var profiles = launchSettings.RootElement.GetProperty("profiles");
Templates.Mvc.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
321var profiles = launchSettings.RootElement.GetProperty("profiles");
Templates.Tests (1)
src\ProjectTemplates\Shared\Project.cs (1)
321var profiles = launchSettings.RootElement.GetProperty("profiles");