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