Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataAnnotationsModelMetadata Class

Provides a container for common metadata, for the DataAnnotationsModelMetadataProvider class, and for the DataAnnotationsModelValidator class for a data model.

System.Object
  System.Web.Mvc.ModelMetadata
    System.Web.Mvc.DataAnnotationsModelMetadata

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public class DataAnnotationsModelMetadata : ModelMetadata

The DataAnnotationsModelMetadata type exposes the following members.

  NameDescription
Public methodDataAnnotationsModelMetadataInitializes a new instance of the DataAnnotationsModelMetadataProvider class.
Top

  NameDescription
Public propertyAdditionalValuesGets a dictionary that contains additional metadata about the model. (Inherited from ModelMetadata.)
Public propertyContainerTypeGets or sets the type of the container for the model. (Inherited from ModelMetadata.)
Public propertyConvertEmptyStringToNullGets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. (Inherited from ModelMetadata.)
Public propertyDataTypeNameGets or sets meta information about the data type. (Inherited from ModelMetadata.)
Public propertyDescriptionGets or sets the description of the model. (Inherited from ModelMetadata.)
Public propertyDisplayFormatStringGets or sets the display format string for the model. (Inherited from ModelMetadata.)
Public propertyDisplayNameGets or sets the display name of the model. (Inherited from ModelMetadata.)
Public propertyEditFormatStringGets or sets the edit format string of the model. (Inherited from ModelMetadata.)
Public propertyHideSurroundingHtmlGets or sets a value that indicates whether the model object should be rendered using associated HTML elements. (Inherited from ModelMetadata.)
Public propertyIsComplexTypeGets or sets a value that indicates whether the model is a complex type. (Inherited from ModelMetadata.)
Public propertyIsNullableValueTypeGets a value that indicates whether the type is nullable. (Inherited from ModelMetadata.)
Public propertyIsReadOnlyGets or sets a value that indicates whether the model is read-only. (Inherited from ModelMetadata.)
Public propertyIsRequiredGets or sets a value that indicates whether the model is required. (Inherited from ModelMetadata.)
Public propertyModelGets the value of the model. (Inherited from ModelMetadata.)
Public propertyModelTypeGets the type of the model. (Inherited from ModelMetadata.)
Public propertyNullDisplayTextGets or sets the string to display for null values. (Inherited from ModelMetadata.)
Public propertyOrderGets or sets a value that represents order of the current metadata. (Inherited from ModelMetadata.)
Public propertyPropertiesGets a collection of model metadata objects that describe the properties of the model. (Inherited from ModelMetadata.)
Public propertyPropertyNameGets the property name. (Inherited from ModelMetadata.)
Protected propertyProviderGets or sets the provider. (Inherited from ModelMetadata.)
Public propertyRequestValidationEnabledGets or sets a value that indicates whether request validation is enabled. (Inherited from ModelMetadata.)
Public propertyShortDisplayNameGets or sets a short display name. (Inherited from ModelMetadata.)
Public propertyShowForDisplayGets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. (Inherited from ModelMetadata.)
Public propertyShowForEditGets or sets a value that indicates whether the model should be displayed in editable views. (Inherited from ModelMetadata.)
Public propertySimpleDisplayTextGets or sets the simple display string for the model. (Inherited from ModelMetadata.)
Public propertyTemplateHintGets or sets a hint that suggests what template to use for this model. (Inherited from ModelMetadata.)
Public propertyWatermarkGets or sets a value that can be used as a watermark. (Inherited from ModelMetadata.)
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetDisplayNameGets the display name for the model. (Inherited from ModelMetadata.)
Public methodGetHashCode (Inherited from Object.)
Protected methodGetSimpleDisplayTextReturns simple text for the model data. (Overrides ModelMetadata.GetSimpleDisplayText().)
Public methodGetType (Inherited from Object.)
Public methodGetValidatorsGets a list of validators for the model. (Inherited from ModelMetadata.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top

DataAnnotationsModelMetadataProvider is the default metadata provider for MVC.

A Visual Studio project with source code is available to accompany this topic: Download.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft