4 instantiations of JsonDocument
System.Text.Json (4)
System\Text\Json\Document\JsonDocument.cs (1)
786new JsonDocument(
System\Text\Json\Document\JsonDocument.Parse.cs (3)
692return new JsonDocument(utf8Json, database, isDisposable: false); 720return new JsonDocument(utf8Json, database, extraRentedArrayPoolBytes, extraPooledByteBufferWriter); 758return new JsonDocument(utf8Json, database, isDisposable: false);
370 references to JsonDocument
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
471var document = JsonDocument.Parse(stream);
Aspire.Hosting.Tests (3)
Helpers\JsonDocumentManifestPublisher.cs (3)
27_manifestDocument = await JsonDocument.ParseAsync(stream, cancellationToken: cancellationToken).ConfigureAwait(false); 30private JsonDocument? _manifestDocument; 32public JsonDocument ManifestDocument
dotnet-openapi (2)
Commands\BaseCommand.cs (2)
463using var packageVersionDocument = await JsonDocument.ParseAsync(packageVersionStream);
dotnet-user-jwts (2)
Helpers\DevJwtCliHelpers.cs (2)
82var launchSettingsJson = JsonDocument.Parse(launchSettingsFileStream);
JwtBearerSample (2)
Startup.cs (2)
77using (var json = JsonDocument.Parse(body))
Microsoft.AspNetCore.Authentication (1)
JsonDocumentAuthExtensions.cs (1)
9/// Authentication extensions to <see cref="JsonDocument"/>.
Microsoft.AspNetCore.Authentication.Facebook (2)
FacebookHandler.cs (2)
58using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted)))
Microsoft.AspNetCore.Authentication.Google (2)
GoogleHandler.cs (2)
56using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted)))
Microsoft.AspNetCore.Authentication.MicrosoftAccount (2)
MicrosoftAccountHandler.cs (2)
52using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted)))
Microsoft.AspNetCore.Authentication.OAuth (8)
OAuthHandler.cs (4)
227true => OAuthTokenResponse.Success(JsonDocument.Parse(body)), 234var exception = OAuthTokenResponse.GetStandardErrorException(JsonDocument.Parse(body)); 254using (var user = JsonDocument.Parse("{}"))
OAuthTokenResponse.cs (4)
18private OAuthTokenResponse(JsonDocument response) 39public static OAuthTokenResponse Success(JsonDocument response) 63public JsonDocument? Response { get; set; } 93internal static Exception? GetStandardErrorException(JsonDocument response)
Microsoft.AspNetCore.Authentication.OpenIdConnect (8)
Events\UserInformationReceivedContext.cs (1)
32public JsonDocument User { get; set; } = default!;
OpenIdConnectHandler.cs (7)
916using (var payload = JsonDocument.Parse("{}")) 1064JsonDocument user; 1068user = JsonDocument.Parse(userInfoResponse); 1073user = JsonDocument.Parse(userInfoEndpointJwt.Payload.SerializeToJson()); 1089using (var updatedUser = userInformationReceivedContext.User) 1333private async Task<UserInformationReceivedContext> RunUserInformationReceivedEventAsync(ClaimsPrincipal principal, AuthenticationProperties properties, OpenIdConnectMessage message, JsonDocument user)
Microsoft.AspNetCore.Authentication.Test (28)
ClaimActionTests.cs (14)
15var userData = JsonDocument.Parse("{ \"name\": \"test\" }"); 29var userData = JsonDocument.Parse("{ \"role\": [ \"role1\", null, \"role2\" ] }"); 47var userData = JsonDocument.Parse("{ \"name\": { \"subkey\": \"test\" } }"); 61var userData = JsonDocument.Parse("{ \"role\": { \"subkey\": [ \"role1\", null, \"role2\" ] } }"); 79var userData = JsonDocument.Parse("{ \"name0\": \"value0\", \"name1\": \"value1\" }"); 94var userData = JsonDocument.Parse("{ \"name0\": \"value0\", \"name1\": \"value1\" }"); 109var userData = JsonDocument.Parse("{ \"name0\": \"value0\", \"name1\": \"value1\" }");
JsonDocumentAuthExtensionsTests.cs (2)
18using (var document = JsonDocument.Parse(json))
JwtBearerTests.cs (4)
954using var dom = JsonDocument.Parse(responseBody); 998using var dom = JsonDocument.Parse(responseBody);
JwtBearerTests_Handler.cs (4)
898using var dom = JsonDocument.Parse(responseBody); 941using var dom = JsonDocument.Parse(responseBody);
OpenIdConnect\UniqueJsonKeyClaimActionTests.cs (4)
15var userData = JsonDocument.Parse("{ \"jsonKey\": \"value\" }"); 31var userData = JsonDocument.Parse("{ \"jsonKey\": \"value\" }");
Microsoft.AspNetCore.Authentication.Twitter (5)
TwitterHandler.cs (5)
116JsonDocument user; 123user = JsonDocument.Parse("{}"); 320private async Task<JsonDocument> RetrieveUserDetailsAsync(AccessToken accessToken) 333var result = JsonDocument.Parse(responseText);
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 (2)
Internal\Json\AnyConverter.cs (2)
23using var d = JsonDocument.ParseValue(ref reader);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (56)
ConverterTests\JsonConverterWriteTests.cs (4)
546using var doc1 = JsonDocument.Parse(jsonNew); 547using var doc2 = JsonDocument.Parse(jsonOld);
ServerStreamingServerCallHandlerTests.cs (14)
67using var responseJson1 = JsonDocument.Parse(line1!); 74using var responseJson2 = JsonDocument.Parse(line2!); 111using var responseJson1 = JsonDocument.Parse(line1!); 115using var responseJson2 = JsonDocument.Parse(line2!); 153using var responseJson1 = JsonDocument.Parse(line1!); 157using var responseJson2 = JsonDocument.Parse(line2!); 194using var responseJson = JsonDocument.Parse(line!);
UnaryServerCallHandlerTests.cs (38)
81using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 119using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 179using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 716using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 748using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 786using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 816using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 840using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 865using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 932using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1010using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1052using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1082using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1111using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1154using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1208using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1235using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1474using var responseJson = JsonDocument.Parse(httpContext.Response.Body); 1735using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
HttpValidationProblemDetailsJsonConverterTest.cs (2)
34var document = JsonDocument.Parse(ms);
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
Infrastructure\DefaultTempDataSerializer.cs (2)
20using var jsonDocument = JsonDocument.Parse(value);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
HttpsTests.cs (1)
162var result = System.Text.Json.JsonDocument.Parse(response).RootElement;
Microsoft.Build (2)
Construction\Solution\SolutionFile.cs (2)
659JsonDocument text = JsonDocument.Parse(File.ReadAllText(solutionFilterFile), options);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
StringCopyPaste\StringCopyPasteData.cs (1)
48var value = JsonSerializer.Deserialize(JsonDocument.Parse(json), typeof(StringCopyPasteData));
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\Json\CSharpJsonParserTests.cs (1)
175JsonDocument.Parse(token.ValueText, new JsonDocumentOptions { AllowTrailingCommas = false, CommentHandling = JsonCommentHandling.Disallow });
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
690public Task ExecutePreSerializedRequestAsync(string methodName, JsonDocument serializedRequest)
Microsoft.CodeAnalysis.Features (2)
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
148options = symbol.ContainingType.Name == nameof(JsonDocument) ? JsonOptions.Strict : default;
PdbSourceDocument\SourceLinkMap.cs (1)
72var root = JsonDocument.Parse(json, new JsonDocumentOptions() { AllowTrailingCommas = true }).RootElement;
Microsoft.CodeAnalysis.LanguageServer.Protocol (9)
Protocol\Converters\ParameterInformationConverter.cs (2)
18using var document = JsonDocument.ParseValue(ref reader);
Protocol\Converters\SumConverter.cs (2)
204using var document = JsonDocument.ParseValue(ref reader);
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (1)
19var data = JsonDocument.ParseValue(ref reader).RootElement;
Protocol\Internal\Converters\ImageIdConverter.cs (2)
19using var document = JsonDocument.ParseValue(ref reader);
Protocol\Internal\Converters\ObjectContentConverter.cs (2)
48using var jsonDocument = JsonDocument.ParseValue(ref reader);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
UriTests.cs (6)
178var jsonDocument = JsonDocument.Parse(requestJson); 233var jsonDocument = JsonDocument.Parse(requestJson); 281var jsonDocument = JsonDocument.Parse(requestJson);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildProjectLoader.SolutionFilterReader.cs (2)
27using var document = JsonDocument.Parse(File.ReadAllText(filterFilename));
Microsoft.DotNet.Arcade.Sdk (2)
src\InstallDotNetCore.cs (2)
59using (JsonDocument jsonDocument = JsonDocument.Parse(bytes))
Microsoft.Extensions.AI (6)
ChatCompletion\ChatCompletion{T}.cs (1)
145if (JsonDocument.Parse(json!).RootElement.TryGetProperty("data", out var data))
Functions\AIFunctionFactory.cs (5)
43/// <see cref="JsonDocument"/>, or <see cref="JsonNode"/>, it is deserialized directly. If the argument is anything else unknown, 71/// <paramref name="serializerOptions"/>. If the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>, 115/// <see cref="JsonDocument"/>, or <see cref="JsonNode"/>, it is deserialized directly. If the argument is anything else unknown, 149/// <paramref name="serializerOptions"/>. If the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>, 382JsonDocument doc => JsonSerializer.Deserialize(doc, typeInfo),
Microsoft.Extensions.AI.Abstractions (2)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (1)
628[typeof(JsonDocument)] = _ => JsonSchema.CreateTrueSchema(),
Utilities\AIJsonUtilities.Defaults.cs (1)
64[JsonSerializable(typeof(JsonDocument))]
Microsoft.Extensions.AI.Abstractions.Tests (18)
ChatCompletion\ChatResponseFormatTests.cs (1)
12private static JsonElement EmptySchema => JsonDocument.Parse("{}").RootElement;
Contents\FunctionCallContentTests..cs (2)
155var arguments = JsonSerializer.Deserialize<Dictionary<string, JsonDocument>>(""" 197var arguments = JsonSerializer.Deserialize<Dictionary<string, JsonDocument>>("""
Functions\AIFunctionParameterMetadataTests.cs (3)
42Schema = JsonDocument.Parse("""{"type":"integer"}"""), 65Schema = JsonDocument.Parse("""{"type":"integer"}"""), 75Schema = JsonDocument.Parse("""{"type":"number"}"""),
Functions\AIFunctionReturnParameterMetadataTests.cs (1)
27Schema = JsonDocument.Parse("""{"type":"integer"}"""),
test\Shared\JsonSchemaExporter\TestTypes.cs (5)
100yield return new TestData<JsonDocument>(JsonDocument.Parse("""[{ "x" : 42 }]"""), "true"); 101yield return new TestData<JsonElement>(JsonDocument.Parse("""[{ "x" : 42 }]""").RootElement, "true"); 117yield return new TestData<JsonElement?>(JsonDocument.Parse("{}").RootElement, "true"); 1225[JsonSerializable(typeof(JsonDocument))]
TestJsonSerializerContext.cs (1)
24[JsonSerializable(typeof(Dictionary<string, JsonDocument>))] // Used in Content tests
Utilities\AIJsonUtilitiesTests.cs (5)
54JsonElement expected = JsonDocument.Parse(""" 85JsonElement expected = JsonDocument.Parse(""" 130JsonElement expected = JsonDocument.Parse(""" 175JsonElement expected = JsonDocument.Parse(""" 230JsonElement expected = JsonDocument.Parse("""
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 (4)
OpenAIModelMapper.ChatCompletion.cs (3)
24private static readonly JsonElement _defaultParameterSchema = JsonDocument.Parse("{}").RootElement; 208using var toolChoiceJson = JsonDocument.Parse(JsonModelHelpers.Serialize(options.ToolChoice).ToMemory());
OpenAIRealtimeExtensions.cs (1)
21private static readonly JsonElement _defaultParameterSchema = JsonDocument.Parse("{}").RootElement;
Microsoft.Extensions.AI.Tests (1)
TestJsonSerializerContext.cs (1)
22[JsonSerializable(typeof(Dictionary<string, JsonDocument>))]
Microsoft.Extensions.Configuration.Json (2)
JsonConfigurationFileParser.cs (2)
31using (JsonDocument doc = JsonDocument.Parse(reader.ReadToEnd(), jsonDocumentOptions))
Microsoft.JSInterop.Tests (2)
Infrastructure\DotNetDispatcherTest.cs (2)
130var result = JsonDocument.Parse(resultJson);
Negotiate.Client (2)
Controllers\AuthTestController.cs (2)
284var details = JsonDocument.Parse(body).RootElement; 304var details = JsonDocument.Parse(body).RootElement;
OpenIdConnectSample (2)
Startup.cs (2)
264using (var payload = JsonDocument.Parse(await tokenResponse.Content.ReadAsStringAsync()))
Shared (1)
JsonSchemaExporter\JsonSchemaExporter.cs (1)
628[typeof(JsonDocument)] = _ => JsonSchema.CreateTrueSchema(),
Shared.Tests (5)
JsonSchemaExporter\TestTypes.cs (5)
100yield return new TestData<JsonDocument>(JsonDocument.Parse("""[{ "x" : 42 }]"""), "true"); 101yield return new TestData<JsonElement>(JsonDocument.Parse("""[{ "x" : 42 }]""").RootElement, "true"); 117yield return new TestData<JsonElement?>(JsonDocument.Parse("{}").RootElement, "true"); 1225[JsonSerializable(typeof(JsonDocument))]
SocialSample (9)
Startup.cs (9)
144using (var user = JsonDocument.Parse(await response.Content.ReadAsStringAsync())) 205using (var user = JsonDocument.Parse(await response.Content.ReadAsStringAsync())) 333using (var payload = JsonDocument.Parse(await refreshResponse.Content.ReadAsStringAsync())) 370using (var payload = JsonDocument.Parse(refreshResponse)) 490private async Task PrintRefreshedTokensAsync(HttpResponse response, JsonDocument payload, AuthenticationProperties authProperties)
System.Text.Json (146)
System\Runtime\InteropServices\JsonMarshal.cs (4)
18/// <exception cref="ObjectDisposedException">The underlying <see cref="JsonDocument"/> has been disposed.</exception> 20/// While the method itself does check for disposal of the underlying <see cref="JsonDocument"/>, 35/// <exception cref="ObjectDisposedException">The underlying <see cref="JsonDocument"/> has been disposed.</exception> 38/// While the method itself does check for disposal of the underlying <see cref="JsonDocument"/>,
System\Text\Json\Document\JsonDocument.cs (2)
102/// The parent <see cref="JsonDocument"/> has been disposed. 785JsonDocument newDocument =
System\Text\Json\Document\JsonDocument.Parse.cs (24)
16private static JsonDocument? s_nullLiteral; 17private static JsonDocument? s_trueLiteral; 18private static JsonDocument? s_falseLiteral; 47public static JsonDocument Parse(ReadOnlyMemory<byte> utf8Json, JsonDocumentOptions options = default) 77public static JsonDocument Parse(ReadOnlySequence<byte> utf8Json, JsonDocumentOptions options = default) 118public static JsonDocument Parse(Stream utf8Json, JsonDocumentOptions options = default) 140internal static JsonDocument ParseRented(PooledByteBufferWriter utf8Json, JsonDocumentOptions options = default) 149internal static JsonDocument ParseValue(Stream utf8Json, JsonDocumentOptions options) 166internal static JsonDocument ParseValue(ReadOnlySpan<byte> utf8Json, JsonDocumentOptions options) 174internal static JsonDocument ParseValue(string json, JsonDocumentOptions options) 196public static Task<JsonDocument> ParseAsync( 209private static async Task<JsonDocument> ParseAsyncCore( 229internal static async Task<JsonDocument> ParseAsyncCoreUnrented( 266public static JsonDocument Parse([StringSyntax(StringSyntaxAttribute.Json)] ReadOnlyMemory<char> json, JsonDocumentOptions options = default) 291internal static JsonDocument ParseValue(ReadOnlyMemory<char> json, JsonDocumentOptions options) 330public static JsonDocument Parse([StringSyntax(StringSyntaxAttribute.Json)] string json, JsonDocumentOptions options = default) 378public static bool TryParseValue(ref Utf8JsonReader reader, [NotNullWhen(true)] out JsonDocument? document) 418public static JsonDocument ParseValue(ref Utf8JsonReader reader) 420bool ret = TryParseValue(ref reader, out JsonDocument? document, shouldThrow: true, useArrayPools: true); 429[NotNullWhen(true)] out JsonDocument? document, 672private static JsonDocument CreateForLiteral(JsonTokenType tokenType) 688JsonDocument Create(byte[] utf8Json) 696private static JsonDocument Parse( 723private static JsonDocument ParseUnrented(
System\Text\Json\Document\JsonDocumentOptions.cs (1)
9/// Provides the ability for the user to define custom behavior when parsing JSON to create a <see cref="JsonDocument"/>.
System\Text\Json\Document\JsonElement.ArrayEnumerator.cs (1)
91_curIdx = _target._idx + JsonDocument.DbRow.Size;
System\Text\Json\Document\JsonElement.cs (53)
14/// Represents a specific JSON value within a <see cref="JsonDocument"/>. 19private readonly JsonDocument _parent; 22internal JsonElement(JsonDocument parent, int idx) 45/// The parent <see cref="JsonDocument"/> has been disposed. 60/// The parent <see cref="JsonDocument"/> has been disposed. 80/// The parent <see cref="JsonDocument"/> has been disposed. 97/// The parent <see cref="JsonDocument"/> has been disposed. 131/// The parent <see cref="JsonDocument"/> has been disposed. 174/// The parent <see cref="JsonDocument"/> has been disposed. 213/// The parent <see cref="JsonDocument"/> has been disposed. 253/// The parent <see cref="JsonDocument"/> has been disposed. 291/// The parent <see cref="JsonDocument"/> has been disposed. 327/// The parent <see cref="JsonDocument"/> has been disposed. 348/// The parent <see cref="JsonDocument"/> has been disposed. 379/// The parent <see cref="JsonDocument"/> has been disposed. 404/// The parent <see cref="JsonDocument"/> has been disposed. 427/// The parent <see cref="JsonDocument"/> has been disposed. 455/// The parent <see cref="JsonDocument"/> has been disposed. 476/// The parent <see cref="JsonDocument"/> has been disposed. 504/// The parent <see cref="JsonDocument"/> has been disposed. 527/// The parent <see cref="JsonDocument"/> has been disposed. 554/// The parent <see cref="JsonDocument"/> has been disposed. 574/// The parent <see cref="JsonDocument"/> has been disposed. 601/// The parent <see cref="JsonDocument"/> has been disposed. 625/// The parent <see cref="JsonDocument"/> has been disposed. 653/// The parent <see cref="JsonDocument"/> has been disposed. 673/// The parent <see cref="JsonDocument"/> has been disposed. 700/// The parent <see cref="JsonDocument"/> has been disposed. 724/// The parent <see cref="JsonDocument"/> has been disposed. 752/// The parent <see cref="JsonDocument"/> has been disposed. 775/// The parent <see cref="JsonDocument"/> has been disposed. 802/// The parent <see cref="JsonDocument"/> has been disposed. 826/// The parent <see cref="JsonDocument"/> has been disposed. 863/// The parent <see cref="JsonDocument"/> has been disposed. 894/// The parent <see cref="JsonDocument"/> has been disposed. 930/// The parent <see cref="JsonDocument"/> has been disposed. 961/// The parent <see cref="JsonDocument"/> has been disposed. 988/// The parent <see cref="JsonDocument"/> has been disposed. 1012/// The parent <see cref="JsonDocument"/> has been disposed. 1040/// The parent <see cref="JsonDocument"/> has been disposed. 1063/// The parent <see cref="JsonDocument"/> has been disposed. 1091/// The parent <see cref="JsonDocument"/> has been disposed. 1114/// The parent <see cref="JsonDocument"/> has been disposed. 1142/// The parent <see cref="JsonDocument"/> has been disposed. 1165/// The parent <see cref="JsonDocument"/> has been disposed. 1199/// The parent <see cref="JsonDocument"/> has been disposed. 1545/// The parent <see cref="JsonDocument"/> has been disposed. 1576/// The parent <see cref="JsonDocument"/> has been disposed. 1602/// The parent <see cref="JsonDocument"/> has been disposed. 1623/// For JsonElement built from <see cref="JsonDocument"/>: 1650/// The parent <see cref="JsonDocument"/> has been disposed. 1684/// original <see cref="JsonDocument"/>. 1688/// original <see cref="JsonDocument"/>.
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (2)
96_curIdx = _target._idx + JsonDocument.DbRow.Size; 104_curIdx += JsonDocument.DbRow.Size;
System\Text\Json\Document\JsonElement.Parse.cs (10)
49bool ret = JsonDocument.TryParseValue(ref reader, out JsonDocument? document, shouldThrow: true, useArrayPools: false); 58JsonDocument document = JsonDocument.ParseValue(utf8Json, options); 64JsonDocument document = JsonDocument.ParseValue(utf8Json, options); 70JsonDocument document = JsonDocument.ParseValue(json, options); 114bool ret = JsonDocument.TryParseValue(ref reader, out JsonDocument? document, shouldThrow: false, useArrayPools: false);
System\Text\Json\Document\JsonProperty.cs (1)
113/// The parent <see cref="JsonDocument"/> has been disposed.
System\Text\Json\Nodes\JsonNode.Parse.cs (2)
157JsonDocument document = await JsonDocument.ParseAsyncCoreUnrented(utf8Json, documentOptions, cancellationToken).ConfigureAwait(false);
System\Text\Json\Nodes\JsonValue.cs (4)
117JsonElement thisElement = ToJsonElement(this, out JsonDocument? thisDocument); 118JsonElement otherElement = ToJsonElement(otherNode, out JsonDocument? otherDocument); 129static JsonElement ToJsonElement(JsonNode node, out JsonDocument? backingDocument) 147backingDocument = JsonDocument.ParseValue(ref reader);
System\Text\Json\Serialization\Converters\Value\JsonDocumentConverter.cs (4)
9internal sealed class JsonDocumentConverter : JsonConverter<JsonDocument?> 13public override JsonDocument Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 15return JsonDocument.ParseValue(ref reader); 18public override void Write(Utf8JsonWriter writer, JsonDocument? value, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (15)
13/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <typeparamref name="TValue"/>. 17/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 31public static TValue? Deserialize<TValue>(this JsonDocument document, JsonSerializerOptions? options = null) 44/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <paramref name="returnType"/>. 47/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 62public static object? Deserialize(this JsonDocument document, Type returnType, JsonSerializerOptions? options = null) 79/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <typeparamref name="TValue"/>. 83/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 95public static TValue? Deserialize<TValue>(this JsonDocument document, JsonTypeInfo<TValue> jsonTypeInfo) 112/// Converts the <see cref="JsonDocument"/> representing a single JSON value into an instance specified by the <paramref name="jsonTypeInfo"/>. 114/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 124public static object? Deserialize(this JsonDocument document, JsonTypeInfo jsonTypeInfo) 141/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <paramref name="returnType"/>. 144/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 176public static object? Deserialize(this JsonDocument document, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (19)
14/// Converts the provided value into a <see cref="JsonDocument"/>. 17/// <returns>A <see cref="JsonDocument"/> representation of the JSON value.</returns> 26public static JsonDocument SerializeToDocument<TValue>(TValue value, JsonSerializerOptions? options = null) 33/// Converts the provided value into a <see cref="JsonDocument"/>. 35/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 51public static JsonDocument SerializeToDocument(object? value, Type inputType, JsonSerializerOptions? options = null) 59/// Converts the provided value into a <see cref="JsonDocument"/>. 62/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 68public static JsonDocument SerializeToDocument<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 80/// Converts the provided value into a <see cref="JsonDocument"/>. 82/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 91public static JsonDocument SerializeToDocument(object? value, JsonTypeInfo jsonTypeInfo) 103/// Converts the provided value into a <see cref="JsonDocument"/>. 105/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 120public static JsonDocument SerializeToDocument(object? value, Type inputType, JsonSerializerContext context) 131private static JsonDocument WriteDocument<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 144return JsonDocument.ParseRented(output, options.GetDocumentOptions()); 152private static JsonDocument WriteDocumentAsObject(object? value, JsonTypeInfo jsonTypeInfo) 165return JsonDocument.ParseRented(output, options.GetDocumentOptions());
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
164/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonDocument"/> values. 167public static JsonConverter<JsonDocument?> JsonDocumentConverter => s_jsonDocumentConverter ??= new JsonDocumentConverter(); 168private static JsonConverter<JsonDocument?>? s_jsonDocumentConverter;
System\Text\Json\ThrowHelper.cs (1)
741throw new ObjectDisposedException(nameof(JsonDocument));
Templates.Blazor.Tests (2)
src\ProjectTemplates\Shared\Project.cs (2)
319using var launchSettings = await JsonDocument.ParseAsync(launchSettingsFile);
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\ProjectTemplates\Shared\Project.cs (2)
319using var launchSettings = await JsonDocument.ParseAsync(launchSettingsFile);
Templates.Blazor.WebAssembly.Tests (2)
src\ProjectTemplates\Shared\Project.cs (2)
319using var launchSettings = await JsonDocument.ParseAsync(launchSettingsFile);
Templates.Mvc.Tests (2)
src\ProjectTemplates\Shared\Project.cs (2)
319using var launchSettings = await JsonDocument.ParseAsync(launchSettingsFile);
Templates.Tests (2)
src\ProjectTemplates\Shared\Project.cs (2)
319using var launchSettings = await JsonDocument.ParseAsync(launchSettingsFile);