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
attributes
IEnumerable<Attribute>The attributes.
containerType
TypeThe type of the container.
modelAccessor
Func<object>The model accessor.
modelType
TypeThe type of the model.
propertyName
stringThe name of the property.
Returns
- ModelMetadata
The metadata for the property.