Class DataAnnotationsModelMetadataProvider
Implements the default model metadata provider for ASP.NET MVC.
public class DataAnnotationsModelMetadataProvider : AssociatedMetadataProvider
- Inheritance
-
DataAnnotationsModelMetadataProvider
- Inherited Members
Constructors
DataAnnotationsModelMetadataProvider()
Initializes a new instance of the DataAnnotationsModelMetadataProvider class.
public DataAnnotationsModelMetadataProvider()
Methods
CreateMetadata(IEnumerable<Attribute>, Type, Func<object>, Type, string)
Gets the metadata for the specified property.
protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName)
Parameters
attributesIEnumerable<Attribute>The attributes.
containerTypeTypeThe type of the container.
modelAccessorFunc<object>The model accessor.
modelTypeTypeThe type of the model.
propertyNamestringThe name of the property.
Returns
- ModelMetadata
The metadata for the property.