Skip to content
This repository has been 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
dougbu opened this issue May 26, 2015 · 1 comment

Comments

@dougbu
Copy link
Member

dougbu commented May 26, 2015

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.

@danroth27 danroth27 added this to the 6.0.0-beta6 milestone May 28, 2015
dougbu added a commit that referenced this issue Jun 15, 2015
- #2610
- make MVC 6's attribute consistent with data annotation's `[MetadataType]`, used in MVC 5
@dougbu
Copy link
Member Author

dougbu commented Jun 15, 2015

296ec77

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants