8 instantiations of JsonTypeInfo
System.Text.Json (8)
System\Text\Json\Serialization\JsonConverterOfT.cs (1)
57return new JsonTypeInfo<T>(this, options);
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (2)
531var listTypeInfo = new JsonTypeInfo<List<T?>>(converter, elementTypeInfo.Options) 550var listTypeInfo = new JsonTypeInfo<List<T?>>(converter, elementTypeInfo.Options)
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
1012info = new JsonTypeInfo<object>(converter, this);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (3)
17var typeInfo = new JsonTypeInfo<T>(converter, options); 33var typeInfo = new JsonTypeInfo<T>(converter, options); 84JsonTypeInfo<T> typeInfo = new JsonTypeInfo<T>(converter, options);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
912return new JsonTypeInfo<T>(converter, options);
226 references to JsonTypeInfo
Microsoft.AspNetCore.Authentication.BearerToken (3)
BearerTokenHandler.cs (3)
83private static JsonTypeInfo<AccessTokenResponse> ResolveAccessTokenJsonTypeInfo(HttpContext httpContext) 86var typeInfo = httpContext.RequestServices.GetService<IOptions<JsonOptions>>() 87?.Value?.SerializerOptions?.GetTypeInfo(typeof(AccessTokenResponse)) as JsonTypeInfo<AccessTokenResponse>;
Microsoft.AspNetCore.Http.Extensions (32)
HttpRequestJsonExtensions.cs (2)
42return request.ReadFromJsonAsync(jsonTypeInfo: (JsonTypeInfo<TValue>)options.GetTypeInfo(typeof(TValue)), cancellationToken); 98JsonTypeInfo<TValue> jsonTypeInfo,
HttpResponseJsonExtensions.cs (2)
116JsonTypeInfo<TValue> jsonTypeInfo, 132static async Task WriteAsJsonAsyncSlow(HttpResponse response, TValue value, JsonTypeInfo<TValue> jsonTypeInfo,
RequestDelegateFactory.cs (26)
1073Expression.Constant(factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(typeof(object)), typeof(JsonTypeInfo<object>))); 1080Expression.Constant(factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(typeof(object)), typeof(JsonTypeInfo<object>))); 1087Expression.Constant(factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(typeof(object)), typeof(JsonTypeInfo<object>))); 1137Expression.Constant(factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(typeof(object)), typeof(JsonTypeInfo<object>))); 1149Expression.Constant(jsonTypeInfo, typeof(JsonTypeInfo<>).MakeGenericType(typeArg))); 1156Expression.Constant(jsonTypeInfo, typeof(JsonTypeInfo<>).MakeGenericType(typeArg))); 1185Expression.Constant(factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(typeof(object)), typeof(JsonTypeInfo<object>))); 1197Expression.Constant(jsonTypeInfo, typeof(JsonTypeInfo<>).MakeGenericType(typeArg))); 1204Expression.Constant(jsonTypeInfo, typeof(JsonTypeInfo<>).MakeGenericType(typeArg))); 1240Expression.Constant(jsonTypeInfo, typeof(JsonTypeInfo<>).MakeGenericType(returnType))); 1248Expression.Constant(jsonTypeInfo, typeof(JsonTypeInfo<>).MakeGenericType(returnType))); 2396private static Task ExecuteValueTaskOfObject(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2398static async Task ExecuteAwaited(ValueTask<object> valueTask, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2411private static Task ExecuteTaskOfObject(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2413static async Task ExecuteAwaited(Task<object> task, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2426private static Task ExecuteAwaitedReturn(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 2431private static Task ExecuteTaskOfTFast<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2435static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2448private static Task ExecuteTaskOfT<T>(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2452static async Task ExecuteAwaited(Task<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2538private static Task ExecuteValueTaskOfTFast<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2540static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2553private static Task ExecuteValueTaskOfT<T>(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2555static async Task ExecuteAwaited(ValueTask<T> task, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo) 2614private static Task WriteJsonResponseFast<T>(HttpResponse response, T value, JsonTypeInfo<T> jsonTypeInfo) 2617private static Task WriteJsonResponse<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo)
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 39public static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo)
Microsoft.AspNetCore.Http.Extensions.Tests (3)
HttpRequestJsonExtensionsTests.cs (2)
267var typeInfo = (JsonTypeInfo<List<int>>)options.GetTypeInfo(typeof(List<int>));
HttpResponseJsonExtensionsTests.cs (1)
457await context.Response.WriteAsJsonAsync(new int[] { 1, 2, 3 }, (JsonTypeInfo<int[]>)options.GetTypeInfo(typeof(int[])));
Microsoft.AspNetCore.Http.Results (5)
HttpResultsHelper.cs (2)
38var jsonTypeInfo = (JsonTypeInfo<TValue>)jsonSerializerOptions.GetTypeInfo(typeof(TValue));
JsonHttpResultOfT.cs (1)
112if (JsonTypeInfo is JsonTypeInfo<TValue> typedJsonTypeInfo)
Results.cs (1)
258public static IResult Json<TValue>(TValue? data, JsonTypeInfo<TValue> jsonTypeInfo, string? contentType = null, int? statusCode = null)
TypedResults.cs (1)
214public static JsonHttpResult<TValue> Json<TValue>(TValue? data, JsonTypeInfo<TValue> jsonTypeInfo, string? contentType = null, int? statusCode = null)
Microsoft.AspNetCore.Http.Results.Tests (3)
ResultsTests.cs (2)
1005Assert.IsAssignableFrom<JsonTypeInfo<string>>(result.JsonTypeInfo); 1033Assert.IsAssignableFrom<JsonTypeInfo<string>>(result.JsonTypeInfo);
TypedResultsTests.cs (1)
890Assert.IsAssignableFrom<JsonTypeInfo<object>>(result.JsonTypeInfo);
Microsoft.AspNetCore.Routing (4)
RequestDelegateFilterPipelineBuilder.cs (2)
30var jsonTypeInfo = (JsonTypeInfo<object>)jsonSerializerOptions.GetReadOnlyTypeInfo(typeof(object));
src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (2)
12public static Task ExecuteReturnAsync(object obj, HttpContext httpContext, JsonTypeInfo<object> jsonTypeInfo) 39public static Task WriteJsonResponseAsync<T>(HttpResponse response, T? value, JsonTypeInfo<T> jsonTypeInfo)
Microsoft.Extensions.AI (4)
ChatCompletion\ChatResponse{T}.cs (2)
94private static T? DeserializeFirstTopLevelObject(string json, JsonTypeInfo<T> typeInfo) 154deserialized = DeserializeFirstTopLevelObject(json!, (JsonTypeInfo<T>)_serializerOptions.GetTypeInfo(typeof(T)));
Embeddings\DistributedCachingEmbeddingGenerator.cs (2)
62return JsonSerializer.Deserialize(existingJson, (JsonTypeInfo<TEmbedding>)_jsonSerializerOptions.GetTypeInfo(typeof(TEmbedding))); 75var newJson = JsonSerializer.SerializeToUtf8Bytes(value, (JsonTypeInfo<TEmbedding>)_jsonSerializerOptions.GetTypeInfo(typeof(TEmbedding)));
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
536(JsonTypeInfo<IDictionary<string, object>>)AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(IDictionary<string, object>)))!);
Microsoft.Extensions.AI.Evaluation.Reporting (10)
JsonSerialization\JsonUtilities.cs (10)
20internal static JsonTypeInfo<Dataset> DatasetTypeInfo => Options.GetTypeInfo<Dataset>(); 21internal static JsonTypeInfo<CacheEntry> CacheEntryTypeInfo => Options.GetTypeInfo<CacheEntry>(); 22internal static JsonTypeInfo<CacheOptions> CacheOptionsTypeInfo => Options.GetTypeInfo<CacheOptions>(); 23internal static JsonTypeInfo<ScenarioRunResult> ScenarioRunResultTypeInfo => Options.GetTypeInfo<ScenarioRunResult>(); 30internal static JsonTypeInfo<Dataset> DatasetTypeInfo => Options.GetTypeInfo<Dataset>(); 31internal static JsonTypeInfo<CacheEntry> CacheEntryTypeInfo => Options.GetTypeInfo<CacheEntry>(); 32internal static JsonTypeInfo<CacheOptions> CacheOptionsTypeInfo => Options.GetTypeInfo<CacheOptions>(); 33internal static JsonTypeInfo<ScenarioRunResult> ScenarioRunResultTypeInfo => Options.GetTypeInfo<ScenarioRunResult>(); 36private static JsonTypeInfo<T> GetTypeInfo<T>(this JsonSerializerOptions options) => (JsonTypeInfo<T>)options.GetTypeInfo(typeof(T));
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (5)
JsonSerialization\AzureStorageJsonUtilities.cs (5)
19internal static JsonTypeInfo<CacheEntry> CacheEntryTypeInfo => Options.GetTypeInfo<CacheEntry>(); 20internal static JsonTypeInfo<ScenarioRunResult> ScenarioRunResultTypeInfo => Options.GetTypeInfo<ScenarioRunResult>(); 27internal static JsonTypeInfo<ScenarioRunResult> ScenarioRunResultTypeInfo => Options.GetTypeInfo<ScenarioRunResult>(); 30private static JsonTypeInfo<T> GetTypeInfo<T>(this JsonSerializerOptions options) => (JsonTypeInfo<T>)options.GetTypeInfo(typeof(T));
Microsoft.Maui (1)
Core\IHybridWebView.cs (1)
65 JsonTypeInfo<TReturnType> returnTypeJsonTypeInfo,
Microsoft.Maui.Controls (1)
HybridWebView\HybridWebView.cs (1)
115 JsonTypeInfo<TReturnType> returnTypeJsonTypeInfo,
System.Memory.Data (2)
System\BinaryData.cs (2)
394public static BinaryData FromObjectAsJson<T>(T jsonSerializable, JsonTypeInfo<T> jsonTypeInfo) 473public T? ToObjectFromJson<T>(JsonTypeInfo<T> jsonTypeInfo)
System.Net.Http.Json (24)
System\Net\Http\Json\HttpClientJsonExtensions.cs (1)
30private static Task<TValue?> FromJsonAsyncCore<TValue>(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken) =>
System\Net\Http\Json\HttpClientJsonExtensions.Delete.cs (2)
117public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) => 130public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Get.AsyncEnumerable.cs (6)
72JsonTypeInfo<TValue> jsonTypeInfo, 90JsonTypeInfo<TValue> jsonTypeInfo, 138var jsonTypeInfo = (JsonTypeInfo<TValue>)JsonHelpers.GetJsonTypeInfo(typeof(TValue), options); 146JsonTypeInfo<TValue> jsonTypeInfo, 156JsonTypeInfo<TValue> jsonTypeInfo,
System\Net\Http\Json\HttpClientJsonExtensions.Get.cs (2)
47public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) => 50public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Patch.cs (2)
97public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) 116public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpClientJsonExtensions.Post.cs (2)
44public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) 52public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpClientJsonExtensions.Put.cs (2)
44public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) 52public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpContentJsonExtensions.AsyncEnumerable.cs (4)
74JsonTypeInfo<TValue> jsonTypeInfo, 89var jsonTypeInfo = (JsonTypeInfo<TValue>)JsonHelpers.GetJsonTypeInfo(typeof(TValue), options); 95JsonTypeInfo<TValue> jsonTypeInfo,
System\Net\Http\Json\HttpContentJsonExtensions.cs (2)
109public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken = default) 124private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken)
System\Net\Http\Json\JsonContent.cs (1)
82public static JsonContent Create<T>(T? inputValue, JsonTypeInfo<T> jsonTypeInfo, MediaTypeHeaderValue? mediaType = null)
System.Text.Json (128)
src\libraries\System.Text.Json\Common\JsonSerializableAttribute.cs (1)
32/// The name of the property for the generated <see cref="JsonTypeInfo{T}"/> for
System\Text\Json\Nodes\JsonNode.cs (2)
389var jsonTypeInfo = (JsonTypeInfo<T>)JsonSerializerOptions.Default.GetTypeInfo(typeof(T));
System\Text\Json\Nodes\JsonValue.cs (4)
67var jsonTypeInfo = (JsonTypeInfo<T>)JsonSerializerOptions.Default.GetTypeInfo(typeof(T)); 82public static JsonValue? Create<T>(T? value, JsonTypeInfo<T> jsonTypeInfo, JsonNodeOptions? options = null) 161internal static JsonValue CreateFromTypeInfo<T>(T value, JsonTypeInfo<T> jsonTypeInfo, JsonNodeOptions? options = null)
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (4)
17private readonly JsonTypeInfo<TValue> _jsonTypeInfo; 20public JsonValueCustomized(TValue value, JsonTypeInfo<TValue> jsonTypeInfo, JsonNodeOptions? options = null): base(value, options) 33JsonTypeInfo<TValue> jsonTypeInfo = _jsonTypeInfo; 38jsonTypeInfo = (JsonTypeInfo<TValue>)options.GetTypeInfoInternal(typeof(TValue));
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (1)
52return ((JsonTypeInfo<TElement>)elementTypeInfo).EffectiveConverter;
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (1)
69return ((JsonTypeInfo<T>)typeInfo).EffectiveConverter;
System\Text\Json\Serialization\Converters\Collection\RootLevelListConverter.cs (2)
16private readonly JsonTypeInfo<T> _elementTypeInfo; 20public RootLevelListConverter(JsonTypeInfo<T> elementTypeInfo)
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (3)
13/// <see cref="JsonTypeInfo{T}.SerializeHandler"/>. This type holds an optional 54Debug.Assert(jsonTypeInfo is JsonTypeInfo<T> typeInfo && typeInfo.SerializeHandler != null); 61((JsonTypeInfo<T>)jsonTypeInfo).SerializeHandler!(writer, value);
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (2)
50private static JsonTypeInfo<T> GetTypeInfo<T>(JsonSerializerOptions? options) 51=> (JsonTypeInfo<T>)GetTypeInfo(options, typeof(T));
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (2)
35JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 86public static TValue? Deserialize<TValue>(this JsonDocument document, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Read.Element.cs (2)
30JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 80public static TValue? Deserialize<TValue>(this JsonElement element, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (3)
32JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 73public static TValue? Deserialize<TValue>(this JsonNode? node, JsonTypeInfo<TValue> jsonTypeInfo) 139private static TValue? ReadFromNode<TValue>(JsonNode? node, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (3)
33JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 78public static TValue? Deserialize<TValue>(ReadOnlySpan<byte> utf8Json, JsonTypeInfo<TValue> jsonTypeInfo) 135private static TValue? ReadFromSpan<TValue>(ReadOnlySpan<byte> utf8Json, JsonTypeInfo<TValue> jsonTypeInfo, int? actualByteCount = null)
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (18)
51JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 83JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 180JsonTypeInfo<TValue> jsonTypeInfo, 237JsonTypeInfo<TValue> jsonTypeInfo) 400JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 418JsonTypeInfo<TValue> jsonTypeInfo, 445JsonTypeInfo<TValue> jsonTypeInfo, 458JsonTypeInfo<T> jsonTypeInfo, 464JsonTypeInfo<List<T?>> listTypeInfo; 480JsonTypeInfo<List<T?>> listTypeInfo, 523static JsonTypeInfo<List<T?>> GetOrAddListTypeInfoForArrayMode(JsonTypeInfo<T> elementTypeInfo) 527return (JsonTypeInfo<List<T?>>)elementTypeInfo._asyncEnumerableArrayTypeInfo; 531var listTypeInfo = new JsonTypeInfo<List<T?>>(converter, elementTypeInfo.Options) 542static JsonTypeInfo<List<T?>> GetOrAddListTypeInfoForRootLevelValueMode(JsonTypeInfo<T> elementTypeInfo) 546return (JsonTypeInfo<List<T?>>)elementTypeInfo._asyncEnumerableRootLevelValueTypeInfo; 550var listTypeInfo = new JsonTypeInfo<List<T?>>(converter, elementTypeInfo.Options)
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (5)
51JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 83JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 191public static TValue? Deserialize<TValue>([StringSyntax(StringSyntaxAttribute.Json)] string json, JsonTypeInfo<TValue> jsonTypeInfo) 227public static TValue? Deserialize<TValue>([StringSyntax(StringSyntaxAttribute.Json)] ReadOnlySpan<char> json, JsonTypeInfo<TValue> jsonTypeInfo) 381private static TValue? ReadFromSpan<TValue>(ReadOnlySpan<char> json, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (3)
61JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 159public static TValue? Deserialize<TValue>(ref Utf8JsonReader reader, JsonTypeInfo<TValue> jsonTypeInfo) 270private static TValue? Read<TValue>(ref Utf8JsonReader reader, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (3)
29JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 71public static byte[] SerializeToUtf8Bytes<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 129private static byte[] WriteBytes<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (3)
28JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 68public static JsonDocument SerializeToDocument<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 122private static JsonDocument WriteDocument<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (3)
28JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 68public static JsonElement SerializeToElement<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 123private static JsonElement WriteElement<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (3)
29JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 69public static JsonNode? SerializeToNode<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 124private static JsonNode? WriteNode<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (2)
30JsonTypeInfo<TValue> jsonTypeInfo, 66JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options);
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (4)
49JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 76JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 162JsonTypeInfo<TValue> jsonTypeInfo, 185JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (5)
32JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 80/// encoding since the implementation internally uses UTF-8. See also <see cref="SerializeToUtf8Bytes{TValue}(TValue, JsonTypeInfo{TValue})"/> 81/// and <see cref="SerializeAsync{TValue}(IO.Stream, TValue, JsonTypeInfo{TValue}, Threading.CancellationToken)"/>. 83public static string Serialize<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 146private static string WriteString<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Utf8JsonWriter.cs (2)
35JsonTypeInfo<TValue> jsonTypeInfo = GetTypeInfo<TValue>(options); 81public static void Serialize<TValue>(Utf8JsonWriter writer, TValue value, JsonTypeInfo<TValue> jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (2)
51/// Returned metadata can be downcast to <see cref="JsonTypeInfo{T}"/> and used with the relevant <see cref="JsonSerializer"/> overloads. 76/// Returned metadata can be downcast to <see cref="JsonTypeInfo{T}"/> and used with the relevant <see cref="JsonSerializer"/> overloads.
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Collections.cs (24)
21public static JsonTypeInfo<TElement[]> CreateArrayInfo<TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TElement[]> collectionInfo) 36public static JsonTypeInfo<TCollection> CreateListInfo<TCollection, TElement>( 55public static JsonTypeInfo<TCollection> CreateDictionaryInfo<TCollection, TKey, TValue>( 80public static JsonTypeInfo<TCollection> CreateImmutableDictionaryInfo<TCollection, TKey, TValue>( 106public static JsonTypeInfo<TCollection> CreateIDictionaryInfo<TCollection, TKey, TValue>( 126public static JsonTypeInfo<TCollection> CreateIReadOnlyDictionaryInfo<TCollection, TKey, TValue>( 146public static JsonTypeInfo<TCollection> CreateImmutableEnumerableInfo<TCollection, TElement>( 169public static JsonTypeInfo<TCollection> CreateIListInfo<TCollection>( 187public static JsonTypeInfo<TCollection> CreateIListInfo<TCollection, TElement>( 205public static JsonTypeInfo<TCollection> CreateISetInfo<TCollection, TElement>( 223public static JsonTypeInfo<TCollection> CreateICollectionInfo<TCollection, TElement>( 241public static JsonTypeInfo<TCollection> CreateStackInfo<TCollection, TElement>( 259public static JsonTypeInfo<TCollection> CreateQueueInfo<TCollection, TElement>( 277public static JsonTypeInfo<TCollection> CreateConcurrentStackInfo<TCollection, TElement>( 295public static JsonTypeInfo<TCollection> CreateConcurrentQueueInfo<TCollection, TElement>( 313public static JsonTypeInfo<TCollection> CreateIEnumerableInfo<TCollection, TElement>( 331public static JsonTypeInfo<TCollection> CreateIAsyncEnumerableInfo<TCollection, TElement>( 348public static JsonTypeInfo<TCollection> CreateIDictionaryInfo<TCollection>( 368public static JsonTypeInfo<TCollection> CreateStackInfo<TCollection>( 386public static JsonTypeInfo<TCollection> CreateQueueInfo<TCollection>( 393private static JsonTypeInfo<TCollection> CreateStackOrQueueInfo<TCollection>( 417public static JsonTypeInfo<TCollection> CreateIEnumerableInfo<TCollection>( 434public static JsonTypeInfo<Memory<TElement>> CreateMemoryInfo<TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<Memory<TElement>> collectionInfo) 448public static JsonTypeInfo<ReadOnlyMemory<TElement>> CreateReadOnlyMemoryInfo<TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<ReadOnlyMemory<TElement>> collectionInfo)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (1)
297public static JsonConverter<T?> GetNullableConverter<T>(JsonTypeInfo<T> underlyingTypeInfo) where T : struct
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (5)
55/// <returns>A <see cref="JsonTypeInfo{T}"/> instance representing the class or struct.</returns> 57public static JsonTypeInfo<T> CreateObjectInfo<T>(JsonSerializerOptions options, JsonObjectInfoValues<T> objectInfo) where T : notnull 69/// <returns>A <see cref="JsonTypeInfo{T}"/> instance representing the type.</returns> 71public static JsonTypeInfo<T> CreateValueInfo<T>(JsonSerializerOptions options, JsonConverter converter) 76JsonTypeInfo<T> info = CreateCore<T>(converter, options);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (6)
15private static JsonTypeInfo<T> CreateCore<T>(JsonConverter converter, JsonSerializerOptions options) 17var typeInfo = new JsonTypeInfo<T>(converter, options); 30private static JsonTypeInfo<T> CreateCore<T>(JsonSerializerOptions options, JsonObjectInfoValues<T> objectInfo) 33var typeInfo = new JsonTypeInfo<T>(converter, options); 71private static JsonTypeInfo<T> CreateCore<T>( 84JsonTypeInfo<T> typeInfo = new JsonTypeInfo<T>(converter, options);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
890Debug.Assert(dictionaryValueInfo is JsonTypeInfo<TValue>); 891return ((JsonTypeInfo<TValue>)dictionaryValueInfo).EffectiveConverter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (2)
149Debug.Assert(jsonTypeInfo is JsonTypeInfo<T>); 154?? ((JsonTypeInfo<T>)jsonTypeInfo).EffectiveConverter; // Fall back to the effective converter for the type.
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (5)
889/// Creates a blank <see cref="JsonTypeInfo{T}"/> instance. 893/// <returns>A blank <see cref="JsonTypeInfo{T}"/> instance.</returns> 896/// The returned <see cref="JsonTypeInfo{T}"/> will be blank, with the exception of the 907public static JsonTypeInfo<T> CreateJsonTypeInfo<T>(JsonSerializerOptions options) 963Type jsonTypeInfoType = typeof(JsonTypeInfo<>).MakeGenericType(type);