This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
ModelMetadataType
chain followed further in MVC 6 than MetadataType
chain in MVC 5 #2610
Closed
Description
For compatibility, should not check property types within a type found using [ModelMetadataType]
.
While confirming the behaviour for #2403, found MVC 6 actually finds more metadata (checks type chains further) than MVC 5. MVC 5 finds no validators with the following model:
[MetadataType(typeof(MergedAttributesMetadata))]
public class MergedAttributes
{
public PropertyType Property { get; set; }
}
public class MergedAttributesMetadata
{
public MetadataPropertyType Property { get; set; }
}
public class PropertyType
{
}
[MetadataPropertyTypeValidator]
public class MetadataPropertyType
{
}
In contrast, MVC 6 will find the MetadataPropertyTypeValidator
. It should not.