44 writes to TypeInfoResolver
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\Json\JsonConverterHelper.cs (1)
49TypeInfoResolver = typeInfoResolver
Microsoft.AspNetCore.Http.Extensions (1)
JsonOptions.cs (1)
27TypeInfoResolver = JsonSerializer.IsReflectionEnabledByDefault ? CreateDefaultTypeResolver() : JsonTypeInfoResolver.Combine()
Microsoft.AspNetCore.Http.Extensions.Tests (22)
HttpRequestJsonExtensionsTests.cs (2)
242options.TypeInfoResolver = new DefaultJsonTypeInfoResolver(); 264options.TypeInfoResolver = new DefaultJsonTypeInfoResolver();
HttpResponseJsonExtensionsTests.cs (2)
455options.TypeInfoResolver = new DefaultJsonTypeInfoResolver(); 476options.TypeInfoResolver = new DefaultJsonTypeInfoResolver();
ProblemDetailsDefaultWriterTest.cs (7)
169options.SerializerOptions.TypeInfoResolver = ProblemDetailsJsonContext.Default; 209options.SerializerOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, CustomProblemDetailsContext2.Default, ProblemDetailsJsonContext.Default); 289options.SerializerOptions.TypeInfoResolver = ProblemDetailsJsonContext.Default; 332options.SerializerOptions.TypeInfoResolver = new DefaultJsonTypeInfoResolver(); 375options.SerializerOptions.TypeInfoResolver = CustomProblemDetailsContext.Default; 418options.SerializerOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, ProblemDetailsJsonContext.Default); 504options.SerializerOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, ProblemDetailsJsonContext.Default);
ProblemDetailsServiceCollectionExtensionsTest.cs (5)
91collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = new TestExtensionsJsonContext()); 114options.SerializerOptions.TypeInfoResolver = new TestExtensionsJsonContext(); 155collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = TestExtensionsJsonContext.Default); 177collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = null); 197collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = new DefaultJsonTypeInfoResolver());
RequestDelegateFactoryTests.cs (1)
1405.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = TestJsonContext.Default)
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
426serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = null);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (1)
216serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default);
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (3)
307serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default); 350o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default; 382serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default);
Microsoft.AspNetCore.Http.Results (1)
JsonHttpResultOfT.cs (1)
41jsonSerializerOptions.TypeInfoResolver ??= new DefaultJsonTypeInfoResolver();
Microsoft.AspNetCore.Http.Results.Tests (6)
HttpResultsHelperTests.cs (6)
33serializerOptions.TypeInfoResolver = TestJsonContext.Default; 64serializerOptions.TypeInfoResolver = TestJsonContext.Default; 97serializerOptions.TypeInfoResolver = TestJsonContext.Default; 131serializerOptions.TypeInfoResolver = TestJsonContext.Default; 165serializerOptions.TypeInfoResolver = TestJsonContext.Default; 193serializerOptions.TypeInfoResolver = TestJsonContext.Default;
Microsoft.AspNetCore.Mvc.Core (1)
JsonOptions.cs (1)
45TypeInfoResolver = JsonSerializer.IsReflectionEnabledByDefault ? CreateDefaultTypeResolver() : JsonTypeInfoResolver.Combine()
Microsoft.AspNetCore.Mvc.Core.Test (3)
Formatters\SystemTextJsonOutputFormatterTest.cs (3)
174jsonOptions.JsonSerializerOptions.TypeInfoResolver = TestJsonContext.Default; 218jsonOptions.JsonSerializerOptions.TypeInfoResolver = TestJsonContext.Default; 263jsonOptions.JsonSerializerOptions.TypeInfoResolver = null;
Microsoft.AspNetCore.OpenApi (1)
Services\Schemas\OpenApiSchemaService.cs (1)
40TypeInfoResolver = jsonOptions.Value.SerializerOptions.TypeInfoResolver?.WithAddedModifier(jsonTypeInfo =>
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (1)
494options.SerializerOptions.TypeInfoResolver = options.SerializerOptions.TypeInfoResolver?.WithAddedModifier(jsonTypeInfo =>
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonUtilities.Defaults.cs (1)
33TypeInfoResolver = new DefaultJsonTypeInfoResolver(),
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\DistributedCachingChatClientTest.cs (1)
630serializerOptions.TypeInfoResolver = serializerOptions.TypeInfoResolver!.WithAddedModifier(typeInfo =>
Shared.Tests (2)
JsonSchemaExporter\JsonSchemaExporterTests.cs (2)
31? new(opts) { TypeInfoResolver = Options.TypeInfoResolver } 43? new(opts) { TypeInfoResolver = Options.TypeInfoResolver }
System.Text.Json (3)
System\Text\Json\Serialization\JsonSerializerContext.cs (2)
31options = new JsonSerializerOptions { TypeInfoResolver = this }; 43options.TypeInfoResolver = this;
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
1134TypeInfoResolver = JsonSerializer.IsReflectionEnabledByDefault
39 references to TypeInfoResolver
Microsoft.AspNetCore.Http.Extensions.Tests (17)
JsonOptionsTests.cs (4)
26Assert.NotNull(options.TypeInfoResolver); 27Assert.IsAssignableFrom<IJsonTypeInfoResolver>(options.TypeInfoResolver); 44Assert.NotNull(options.TypeInfoResolver); 45Assert.IsType<DefaultJsonTypeInfoResolver>(options.TypeInfoResolver);
ProblemDetailsServiceCollectionExtensionsTest.cs (13)
101Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 102Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 103Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 166Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 167Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 168Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 187Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 188Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 207Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 208Assert.IsNotType<DefaultJsonTypeInfoResolver>(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 209Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 210Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 232Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver);
Microsoft.AspNetCore.Mvc.Core.Test (6)
Formatters\SystemTextJsonOutputFormatterTest.cs (2)
285Assert.IsAssignableFrom<IJsonTypeInfoResolver>(stjOutputFormatter.SerializerOptions.TypeInfoResolver); 289Assert.IsType<DefaultJsonTypeInfoResolver>(stjOutputFormatter.SerializerOptions.TypeInfoResolver);
JsonOptionsTest.cs (4)
25Assert.NotNull(options.TypeInfoResolver); 26Assert.IsAssignableFrom<IJsonTypeInfoResolver>(options.TypeInfoResolver); 43Assert.NotNull(options.TypeInfoResolver); 44Assert.IsType<DefaultJsonTypeInfoResolver>(options.TypeInfoResolver);
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (1)
494options.SerializerOptions.TypeInfoResolver = options.SerializerOptions.TypeInfoResolver?.WithAddedModifier(jsonTypeInfo =>
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\DistributedCachingChatClientTest.cs (1)
630serializerOptions.TypeInfoResolver = serializerOptions.TypeInfoResolver!.WithAddedModifier(typeInfo =>
Shared.Tests (2)
JsonSchemaExporter\JsonSchemaExporterTests.cs (2)
31? new(opts) { TypeInfoResolver = Options.TypeInfoResolver } 43? new(opts) { TypeInfoResolver = Options.TypeInfoResolver }
System.Text.Json (12)
System\Text\Json\Serialization\JsonConverterOfT.cs (1)
667if (!IsInternalConverter && options.TypeInfoResolver is not JsonSerializerContext)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
132ThrowHelper.ThrowNotSupportedException_NoMetadataForType(type, TypeInfoResolver);
System\Text\Json\Serialization\JsonSerializerOptions.cs (8)
254/// This property is auxiliary to and is kept in sync with the <see cref="TypeInfoResolver"/> property. 255/// Any change made to this property will be reflected by <see cref="TypeInfoResolver"/> and vice versa. 848Debug.Assert(TypeInfoResolver != null); 849return _canUseFastPathSerializationLogic ??= TypeInfoResolver.IsCompatibleWithOptions(this); 875/// <exception cref="InvalidOperationException">The instance does not specify a <see cref="TypeInfoResolver"/> setting.</exception> 890/// <param name="populateMissingResolver">Populates unconfigured <see cref="TypeInfoResolver"/> properties with the reflection-based default.</param> 892/// The instance does not specify a <see cref="TypeInfoResolver"/> setting. Thrown if <paramref name="populateMissingResolver"/> is <see langword="false"/>. 1145private string DebuggerDisplay => $"TypeInfoResolver = {(TypeInfoResolver?.ToString() ?? "<null>")}, IsReadOnly = {IsReadOnly}";
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
141JsonSerializerContext? context = typeInfo.Options.TypeInfoResolver as JsonSerializerContext;
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
376ThrowHelper.ThrowInvalidOperationException_NoMetadataForTypeProperties(Options.TypeInfoResolver, Type);