4 instantiations of JsonDocument
System.Text.Json (4)
417 references to JsonDocument
aspire (8)
DotNetCliRunner.cs (6)
23Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken);
135public async Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
184var json = JsonDocument.Parse(stdout!);
722using var document = JsonDocument.Parse(stdout);
Aspire.Cli.Tests (2)
TestServices\TestDotNetCliRunner.cs (2)
16public Func<FileInfo, string[], string[], DotNetCliRunnerInvocationOptions, CancellationToken, (int ExitCode, JsonDocument? Output)>? GetProjectItemsAndPropertiesAsyncCallback { get; set; }
53public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
Aspire.Hosting.PostgreSQL.Tests (2)
Aspire.Hosting.Seq.Tests (2)
Aspire.Hosting.Tests (3)
dotnet-openapi (2)
dotnet-user-jwts (2)
JwtBearerSample (2)
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.Facebook (2)
Microsoft.AspNetCore.Authentication.Google (2)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (2)
Microsoft.AspNetCore.Authentication.OAuth (8)
Microsoft.AspNetCore.Authentication.OpenIdConnect (8)
Microsoft.AspNetCore.Authentication.Test (28)
Microsoft.AspNetCore.Authentication.Twitter (5)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (56)
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (2)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (2)
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.Build (2)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Microsoft.CodeAnalysis.Features (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
Microsoft.DotNet.Arcade.Sdk (2)
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (8)
Functions\AIFunctionFactory.cs (7)
91/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>,
165/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>,
254/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>,
338/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>,
394/// <see cref="JsonDocument"/>, or <see cref="JsonNode"/>, it is deserialized directly. If the argument is anything else unknown,
440/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>,
819JsonDocument doc => JsonSerializer.Deserialize(doc, typeInfo),
Microsoft.Extensions.AI.Abstractions.Tests (28)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
Microsoft.Extensions.AI.Evaluation.Safety (10)
Microsoft.Extensions.AI.Ollama (3)
Microsoft.Extensions.AI.OpenAI.Tests (2)
Microsoft.Extensions.AI.Tests (3)
Microsoft.Extensions.Configuration.Json (2)
Microsoft.JSInterop.Tests (2)
Microsoft.ML.Tokenizers.Tests (2)
Negotiate.Client (2)
OpenIdConnectSample (2)
Shared (1)
Shared.Tests (5)
SocialSample (9)
System.Text.Json (156)
System\Text\Json\Document\JsonDocument.Parse.cs (27)
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)
122public static JsonDocument Parse(Stream utf8Json, JsonDocumentOptions options = default)
145internal static JsonDocument ParseRented(PooledByteBufferWriter utf8Json, JsonDocumentOptions options = default)
155internal static JsonDocument ParseValue(Stream utf8Json, JsonDocumentOptions options)
175internal static JsonDocument ParseValue(ReadOnlySpan<byte> utf8Json, JsonDocumentOptions options)
186internal static JsonDocument ParseValue(string json, JsonDocumentOptions options)
208public static Task<JsonDocument> ParseAsync(
218private static async Task<JsonDocument> ParseAsyncCore(
242internal static async Task<JsonDocument> ParseAsyncCoreUnrented(
282public static JsonDocument Parse([StringSyntax(StringSyntaxAttribute.Json)] ReadOnlyMemory<char> json, JsonDocumentOptions options = default)
308internal static JsonDocument ParseValue(ReadOnlySpan<char> json, JsonDocumentOptions options)
349public static JsonDocument Parse([StringSyntax(StringSyntaxAttribute.Json)] string json, JsonDocumentOptions options = default)
394public static bool TryParseValue(ref Utf8JsonReader reader, [NotNullWhen(true)] out JsonDocument? document)
434public static JsonDocument ParseValue(ref Utf8JsonReader reader) =>
437internal static JsonDocument ParseValue(ref Utf8JsonReader reader, bool allowDuplicateProperties)
439bool ret = TryParseValue(ref reader, out JsonDocument? document, shouldThrow: true, useArrayPools: true, allowDuplicateProperties);
448[NotNullWhen(true)] out JsonDocument? document,
692private static JsonDocument CreateForLiteral(JsonTokenType tokenType)
708JsonDocument Create(byte[] utf8Json)
716private static JsonDocument Parse(
726JsonDocument document;
753private static JsonDocument ParseUnrented(
789JsonDocument document = new JsonDocument(utf8Json, database, isDisposable: false);
System\Text\Json\Document\JsonElement.Parse.cs (14)
49bool ret = JsonDocument.TryParseValue(ref reader, out JsonDocument? document, shouldThrow: true, useArrayPools: false);
58bool ret = JsonDocument.TryParseValue(
60out JsonDocument? document,
72JsonDocument document = JsonDocument.ParseValue(utf8Json, options);
86JsonDocument document = JsonDocument.ParseValue(utf8Json, options);
100JsonDocument document = JsonDocument.ParseValue(json, options);
117JsonDocument document = JsonDocument.ParseValue(json, options);
161bool ret = JsonDocument.TryParseValue(ref reader, out JsonDocument? document, shouldThrow: false, useArrayPools: false);
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)
77/// Converts the provided value into a <see cref="JsonDocument"/>.
79/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns>
88public static JsonDocument SerializeToDocument(object? value, JsonTypeInfo jsonTypeInfo)
97/// Converts the provided value into a <see cref="JsonDocument"/>.
99/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns>
114public static JsonDocument SerializeToDocument(object? value, Type inputType, JsonSerializerContext context)
122private static JsonDocument WriteDocument<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
135return JsonDocument.ParseRented(output, options.GetDocumentOptions());
143private static JsonDocument WriteDocumentAsObject(object? value, JsonTypeInfo jsonTypeInfo)
156return JsonDocument.ParseRented(output, options.GetDocumentOptions());
Templates.Blazor.Tests (2)
Templates.Blazor.WebAssembly.Auth.Tests (2)
Templates.Blazor.WebAssembly.Tests (2)
Templates.Mvc.Tests (2)
Templates.Tests (2)