Class CachedDataAnnotationsModelMetadata
Provides a container for common metadata, for the DataAnnotationsModelMetadataProvider class, for a data model.
public class CachedDataAnnotationsModelMetadata : CachedModelMetadata<CachedDataAnnotationsMetadataAttributes>
- Inheritance
-
CachedDataAnnotationsModelMetadata
- Inherited Members
Constructors
CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadata, Func<object>)
Initializes a new instance of the CachedDataAnnotationsModelMetadata class.
public CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadata prototype, Func<object> modelAccessor)
Parameters
prototypeCachedDataAnnotationsModelMetadataThe prototype used to initialize the model metadata.
modelAccessorFunc<object>The model accessor.
CachedDataAnnotationsModelMetadata(DataAnnotationsModelMetadataProvider, Type, Type, string, IEnumerable<Attribute>)
Initializes a new instance of the CachedDataAnnotationsModelMetadata class.
public CachedDataAnnotationsModelMetadata(DataAnnotationsModelMetadataProvider provider, Type containerType, Type modelType, string propertyName, IEnumerable<Attribute> attributes)
Parameters
providerDataAnnotationsModelMetadataProviderThe metadata provider.
containerTypeTypeThe type of the container.
modelTypeTypeThe type of the model.
propertyNamestringThe name of the property.
attributesIEnumerable<Attribute>The attributes that provides data for the initialization.
Methods
ComputeConvertEmptyStringToNull()
Retrieves a value that indicates whether empty strings that are posted back in forms should be converted to null.
protected override bool ComputeConvertEmptyStringToNull()
Returns
- bool
true if empty strings that are posted back in forms should be converted to null; otherwise, false.
ComputeDescription()
Retrieves the description of the model.
protected override string ComputeDescription()
Returns
- string
The description of the model.
ComputeIsReadOnly()
Retrieves a value that indicates whether the model is read-only.
protected override bool ComputeIsReadOnly()
Returns
- bool
true if the model is read-only; otherwise, false.
GetDisplayName()
public override string GetDisplayName()