1 write to PolymorphicTypeResolver
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
751PolymorphicTypeResolver = new PolymorphicTypeResolver(Options, PolymorphismOptions, Type, Converter.CanHaveMetadata);
15 references to PolymorphicTypeResolver
System.Text.Json (15)
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (1)
269Debug.Assert(JsonSerializer.IsMetadataPropertyName(reader.GetUnescapedSpan(), (state.Current.BaseJsonTypeInfo ?? jsonTypeInfo).PolymorphicTypeResolver), "should only be hit if metadata property.");
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (1)
253if (JsonSerializer.IsMetadataPropertyName(propertyName, state.Current.BaseJsonTypeInfo.PolymorphicTypeResolver))
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (4)
20Debug.Assert(jsonTypeInfo.PolymorphicTypeResolver?.UsesTypeDiscriminators == true); 30PolymorphicTypeResolver resolver = jsonTypeInfo.PolymorphicTypeResolver; 73Debug.Assert(CanBePolymorphic || jsonTypeInfo.PolymorphicTypeResolver != null); 92if (jsonTypeInfo.PolymorphicTypeResolver is PolymorphicTypeResolver resolver)
System\Text\Json\Serialization\JsonConverterOfT.cs (1)
380bool canBePolymorphic = CanBePolymorphic || jsonTypeInfo.PolymorphicTypeResolver is not null;
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (3)
83switch (state.Current.LatestMetadataPropertyName = GetMetadataPropertyName(propertyName, jsonTypeInfo.PolymorphicTypeResolver)) 128state.Current.JsonPropertyName = jsonTypeInfo.PolymorphicTypeResolver?.CustomTypeDiscriminatorPropertyNameUtf8 ?? s_typePropertyName; 130if (jsonTypeInfo.PolymorphicTypeResolver is null)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
89if (IsMetadataPropertyName(propertyName, state.Current.BaseJsonTypeInfo.PolymorphicTypeResolver))
System\Text\Json\Serialization\ReadStack.cs (2)
108Current.CanContainMetadata = PreserveReferences || jsonTypeInfo.PolymorphicTypeResolver?.UsesTypeDiscriminators == true; 137Current.CanContainMetadata = PreserveReferences || jsonTypeInfo.PolymorphicTypeResolver?.UsesTypeDiscriminators == true;
System\Text\Json\ThrowHelper.Serialization.cs (2)
628if (typeInfo.PolymorphicTypeResolver?.UsesTypeDiscriminators is true) 801MetadataPropertyName name = JsonSerializer.GetMetadataPropertyName(propertyName, state.Current.BaseJsonTypeInfo.PolymorphicTypeResolver);