Class CachedDataAnnotationsModelMetadata
Provides a container to cache DataAnnotationsModelMetadata.
public class CachedDataAnnotationsModelMetadata : CachedModelMetadata<CachedDataAnnotationsMetadataAttributes>
- Inheritance
-
CachedDataAnnotationsModelMetadata
- Inherited Members
Constructors
CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadata, Func<object>)
Initializes a new instance of the CachedDataAnnotationsModelMetadata class using the prototype and model accessor.
public CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadata prototype, Func<object> modelAccessor)
Parameters
prototype
CachedDataAnnotationsModelMetadataThe prototype.
modelAccessor
Func<object>The model accessor.
CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadataProvider, Type, Type, string, IEnumerable<Attribute>)
Initializes a new instance of the CachedDataAnnotationsModelMetadata class using the provider, container type, model type, property name and attributes.
public CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadataProvider provider, Type containerType, Type modelType, string propertyName, IEnumerable<Attribute> attributes)
Parameters
provider
CachedDataAnnotationsModelMetadataProviderThe provider.
containerType
TypeThe container type.
modelType
TypeThe model type.
propertyName
stringThe property name.
attributes
IEnumerable<Attribute>The attributes.
Methods
ComputeConvertEmptyStringToNull()
Gets a value that indicates whether empty strings that are posted back in forms should be converted to Nothing.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override bool ComputeConvertEmptyStringToNull()
Returns
- bool
A value that indicates whether empty strings that are posted back in forms should be converted to Nothing.
ComputeDataTypeName()
Gets meta information about the data type.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeDataTypeName()
Returns
- string
Meta information about the data type.
ComputeDescription()
Gets the description of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeDescription()
Returns
- string
The description of the model.
ComputeDisplayFormatString()
Gets the display format string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeDisplayFormatString()
Returns
- string
The display format string for the model.
ComputeDisplayName()
Gets the display name of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeDisplayName()
Returns
- string
The display name of the model.
ComputeEditFormatString()
Gets the edit format string of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeEditFormatString()
Returns
- string
The edit format string of the model.
ComputeHasNonDefaultEditFormat()
Gets a value that indicates whether the model uses a non-default edit format.
protected override bool ComputeHasNonDefaultEditFormat()
Returns
- bool
A value that indicates whether non-default edit format is used.
ComputeHideSurroundingHtml()
Gets a value that indicates whether the model object should be rendered using associated HTML elements.Gets a value that indicates whether the model object should be rendered using associated HTML elements.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override bool ComputeHideSurroundingHtml()
Returns
- bool
A value that indicates whether the model object should be rendered using associated HTML elements.
ComputeHtmlEncode()
protected override bool ComputeHtmlEncode()
Returns
ComputeIsReadOnly()
Gets a value that indicates whether the model is read-only.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override bool ComputeIsReadOnly()
Returns
- bool
A value that indicates whether the model is read-only.
ComputeIsRequired()
Gets a value that indicates whether the model is required.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override bool ComputeIsRequired()
Returns
- bool
A value that indicates whether the model is required.
ComputeNullDisplayText()
Gets the string to display for null values.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeNullDisplayText()
Returns
- string
The string to display for null values.
ComputeOrder()
Gets a value that represents order of the current metadata.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override int ComputeOrder()
Returns
- int
A value that represents order of the current metadata.
ComputeShortDisplayName()
Gets a short display name.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeShortDisplayName()
Returns
- string
A short display name.
ComputeShowForDisplay()
Gets a value that indicates whether the property should be displayed in read-only views such as list and detail views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override bool ComputeShowForDisplay()
Returns
- bool
A value that indicates whether the property should be displayed in read-only views such as list and detail views.
ComputeShowForEdit()
Gets or sets a value that indicates whether the model should be displayed in editable views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override bool ComputeShowForEdit()
Returns
ComputeSimpleDisplayText()
Gets the simple display string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeSimpleDisplayText()
Returns
- string
The simple display string for the model.
ComputeTemplateHint()
Gets a hint that suggests what template to use for this model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeTemplateHint()
Returns
- string
A hint that suggests what template to use for this model.
ComputeWatermark()
Gets a value that can be used as a watermark.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache.
protected override string ComputeWatermark()
Returns
- string
A value that can be used as a watermark.