ModelMetadata ModelMetadata ModelMetadata Class

Definition

Provides a container for common metadata, for the ModelMetadataProvider class, and for the ModelValidator class for a data model.

public class ModelMetadata
type ModelMetadata = class
Public Class ModelMetadata
Inheritance
ModelMetadataModelMetadataModelMetadata
Derived

Constructors

ModelMetadata(ModelMetadataProvider, Type, Func<Object>, Type, String) ModelMetadata(ModelMetadataProvider, Type, Func<Object>, Type, String) ModelMetadata(ModelMetadataProvider, Type, Func<Object>, Type, String)

Initializes a new instance of the ModelMetadata class.

Fields

DefaultOrder DefaultOrder DefaultOrder

The default order value, which is 10000.

Properties

AdditionalValues AdditionalValues AdditionalValues

Gets a dictionary that contains additional metadata about the model.

Container Container Container

A reference to the model's container object. Will be non-null if the model represents a property.

ContainerType ContainerType ContainerType

Gets or sets the type of the container for the model.

ConvertEmptyStringToNull ConvertEmptyStringToNull ConvertEmptyStringToNull

Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null.

DataTypeName DataTypeName DataTypeName

Gets or sets meta information about the data type.

Description Description Description

Gets or sets the description of the model.

DisplayFormatString DisplayFormatString DisplayFormatString

Gets or sets the display format string for the model.

DisplayName DisplayName DisplayName

Gets or sets the display name of the model.

EditFormatString EditFormatString EditFormatString

Gets or sets the edit format string of the model.

HideSurroundingHtml HideSurroundingHtml HideSurroundingHtml

Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements.

HtmlEncode HtmlEncode HtmlEncode
IsComplexType IsComplexType IsComplexType

Gets or sets a value that indicates whether the model is a complex type.

IsNullableValueType IsNullableValueType IsNullableValueType

Gets a value that indicates whether the type is nullable.

IsReadOnly IsReadOnly IsReadOnly

Gets or sets a value that indicates whether the model is read-only.

IsRequired IsRequired IsRequired

Gets or sets a value that indicates whether the model is required.

Model Model Model

Gets the value of the model.

ModelType ModelType ModelType

Gets the type of the model.

NullDisplayText NullDisplayText NullDisplayText

Gets or sets the string to display for null values.

Order Order Order

Gets or sets a value that represents order of the current metadata.

Properties Properties Properties

Gets a collection of model metadata objects that describe the properties of the model.

PropertyName PropertyName PropertyName

Gets the property name.

Provider Provider Provider

Gets or sets the provider.

RequestValidationEnabled RequestValidationEnabled RequestValidationEnabled

Gets or sets a value that indicates whether request validation is enabled.

ShortDisplayName ShortDisplayName ShortDisplayName

Gets or sets a short display name.

ShowForDisplay ShowForDisplay ShowForDisplay

Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views.

ShowForEdit ShowForEdit ShowForEdit

Gets or sets a value that indicates whether the model should be displayed in editable views.

SimpleDisplayText SimpleDisplayText SimpleDisplayText

Gets or sets the simple display string for the model.

TemplateHint TemplateHint TemplateHint

Gets or sets a hint that suggests what template to use for this model.

Watermark Watermark Watermark

Gets or sets a value that can be used as a watermark.

Methods

FromLambdaExpression<TParameter,TValue>(Expression<Func<TParameter,TValue>>, ViewDataDictionary<TParameter>) FromLambdaExpression<TParameter,TValue>(Expression<Func<TParameter,TValue>>, ViewDataDictionary<TParameter>) FromLambdaExpression<TParameter,TValue>(Expression<Func<TParameter,TValue>>, ViewDataDictionary<TParameter>)

Returns the metadata from the Expression parameter for the model.

FromStringExpression(String, ViewDataDictionary) FromStringExpression(String, ViewDataDictionary) FromStringExpression(String, ViewDataDictionary)

Gets the metadata from the expression parameter for the model.

GetDisplayName() GetDisplayName() GetDisplayName()

Gets the display name for the model.

GetSimpleDisplayText() GetSimpleDisplayText() GetSimpleDisplayText()

Returns the simple description of the model.

GetValidators(ControllerContext) GetValidators(ControllerContext) GetValidators(ControllerContext)

Gets a list of validators for the model.

Applies to