You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
Currently GetMetadataForType() includes the given Type's metadata as well as that provided by the Type referenced in an associated [ModelMetadataType] (if any). Similarly GetMetadataForProperty() includes the given property's metadata, that provided by the Type referenced in a [ModelMetadataType] associated with the property (if any), and the property's Type. However GetMetadataForProperty() does not include metadata from a Type referenced in a [ModelMetadataType] associated with the property's Type. Need to check MVC 5 behaviour for this case and do the Right Thing:tm: to maintain compatibility.
The text was updated successfully, but these errors were encountered:
Behaviour w.r.t. [MetadataType] or [ModelMetadataType] on a property's Type in MVC 5 and 6 is consistent: Neither version brings information in from AnotherType in the example below i.e. the only visible validators are PropertyTypeValidatorAttribute and the adapter for RequiredAttribute.
publicclassMergedAttributes{[Required]publicPropertyTypeProperty{get;set;}}[PropertyTypeValidator][MetadataType(typeof(AnotherType))]publicclassPropertyType{}// Not seen when using MVC 5 or 6.[AnotherTypeValidator][HiddenInput]publicclassAnotherType{}
However the two versions are inconsistent in a different way. Will open a new bug for that inconsistency.
Currently
GetMetadataForType()
includes the givenType
's metadata as well as that provided by theType
referenced in an associated[ModelMetadataType]
(if any). SimilarlyGetMetadataForProperty()
includes the given property's metadata, that provided by theType
referenced in a[ModelMetadataType]
associated with the property (if any), and the property'sType
. HoweverGetMetadataForProperty()
does not include metadata from aType
referenced in a[ModelMetadataType]
associated with the property'sType
. Need to check MVC 5 behaviour for this case and do the Right Thing:tm: to maintain compatibility.The text was updated successfully, but these errors were encountered: