Table of Contents

Class DataAnnotationsModelMetadataProvider

Namespace
System.Web.Http.Metadata.Providers
Assembly
System.Web.Http.dll

Implements the default model metadata provider.

public class DataAnnotationsModelMetadataProvider : AssociatedMetadataProvider<CachedDataAnnotationsModelMetadata>
Inheritance
DataAnnotationsModelMetadataProvider
Inherited Members

Constructors

DataAnnotationsModelMetadataProvider()

Initializes a new instance of the DataAnnotationsModelMetadataProvider class.

public DataAnnotationsModelMetadataProvider()

Methods

CreateMetadataFromPrototype(CachedDataAnnotationsModelMetadata, Func<object>)

Creates the metadata from prototype for the specified property.

protected override CachedDataAnnotationsModelMetadata CreateMetadataFromPrototype(CachedDataAnnotationsModelMetadata prototype, Func<object> modelAccessor)

Parameters

prototype CachedDataAnnotationsModelMetadata

The prototype.

modelAccessor Func<object>

The model accessor.

Returns

CachedDataAnnotationsModelMetadata

The metadata for the property.

CreateMetadataPrototype(IEnumerable<Attribute>, Type, Type, string)

Creates the metadata for the specified property.

protected override CachedDataAnnotationsModelMetadata CreateMetadataPrototype(IEnumerable<Attribute> attributes, Type containerType, Type modelType, string propertyName)

Parameters

attributes IEnumerable<Attribute>

The attributes.

containerType Type

The type of the container.

modelType Type

The type of the model.

propertyName string

The name of the property.

Returns

CachedDataAnnotationsModelMetadata

The metadata for the property.