Table of Contents

Class DataAnnotationsModelMetadataProvider

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Implements the default model metadata provider for ASP.NET MVC.

public class DataAnnotationsModelMetadataProvider : AssociatedMetadataProvider
Inheritance
DataAnnotationsModelMetadataProvider
Inherited Members

Constructors

DataAnnotationsModelMetadataProvider()

Initializes a new instance of the DataAnnotationsModelMetadataProvider class.

public DataAnnotationsModelMetadataProvider()

Methods

CreateMetadata(IEnumerable<Attribute>, Type, Func<object>, Type, string)

Gets the metadata for the specified property.

protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName)

Parameters

attributes IEnumerable<Attribute>

The attributes.

containerType Type

The type of the container.

modelAccessor Func<object>

The model accessor.

modelType Type

The type of the model.

propertyName string

The name of the property.

Returns

ModelMetadata

The metadata for the property.