Table of Contents

Class CachedDataAnnotationsModelMetadata

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

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

public class CachedDataAnnotationsModelMetadata : CachedModelMetadata<CachedDataAnnotationsMetadataAttributes>
Inheritance
CachedDataAnnotationsModelMetadata
Inherited Members

Constructors

CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadata, Func<object>)

Initializes a new instance of the CachedDataAnnotationsModelMetadata class.

public CachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadata prototype, Func<object> modelAccessor)

Parameters

prototype CachedDataAnnotationsModelMetadata

The prototype used to initialize the model metadata.

modelAccessor Func<object>

The model accessor.

CachedDataAnnotationsModelMetadata(DataAnnotationsModelMetadataProvider, Type, Type, string, IEnumerable<Attribute>)

Initializes a new instance of the CachedDataAnnotationsModelMetadata class.

public CachedDataAnnotationsModelMetadata(DataAnnotationsModelMetadataProvider provider, Type containerType, Type modelType, string propertyName, IEnumerable<Attribute> attributes)

Parameters

provider DataAnnotationsModelMetadataProvider

The metadata provider.

containerType Type

The type of the container.

modelType Type

The type of the model.

propertyName string

The name of the property.

attributes IEnumerable<Attribute>

The attributes that provides data for the initialization.

Methods

ComputeConvertEmptyStringToNull()

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

protected override bool ComputeConvertEmptyStringToNull()

Returns

bool

true if empty strings that are posted back in forms should be converted to null; otherwise, false.

ComputeDescription()

Retrieves the description of the model.

protected override string ComputeDescription()

Returns

string

The description of the model.

ComputeIsReadOnly()

Retrieves a value that indicates whether the model is read-only.

protected override bool ComputeIsReadOnly()

Returns

bool

true if the model is read-only; otherwise, false.