Class DataAnnotationsModelMetadataProvider
Implements the default model metadata provider.
public class DataAnnotationsModelMetadataProvider : AssociatedMetadataProvider<CachedDataAnnotationsModelMetadata>
- Inheritance
-
DataAnnotationsModelMetadataProvider
- Inherited Members
Constructors
DataAnnotationsModelMetadataProvider()
Initializes a new instance of the DataAnnotationsModelMetadataProvider class.
public DataAnnotationsModelMetadataProvider()
Methods
CreateMetadataFromPrototype(CachedDataAnnotationsModelMetadata, Func<object>)
Creates the metadata from prototype for the specified property.
protected override CachedDataAnnotationsModelMetadata CreateMetadataFromPrototype(CachedDataAnnotationsModelMetadata prototype, Func<object> modelAccessor)
Parameters
prototype
CachedDataAnnotationsModelMetadataThe prototype.
modelAccessor
Func<object>The model accessor.
Returns
- CachedDataAnnotationsModelMetadata
The metadata for the property.
CreateMetadataPrototype(IEnumerable<Attribute>, Type, Type, string)
Creates the metadata for the specified property.
protected override CachedDataAnnotationsModelMetadata CreateMetadataPrototype(IEnumerable<Attribute> attributes, Type containerType, Type modelType, string propertyName)
Parameters
attributes
IEnumerable<Attribute>The attributes.
containerType
TypeThe type of the container.
modelType
TypeThe type of the model.
propertyName
stringThe name of the property.
Returns
- CachedDataAnnotationsModelMetadata
The metadata for the property.