DataAnnotationsModelMetadataProvider.CreateMetadata Method

Definition

Creates metadata for a specified model.

protected override System.Web.ModelBinding.ModelMetadata CreateMetadata (System.Collections.Generic.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, or null if there is no container.

modelAccessor
Func<Object>

The model accessor.

modelType
Type

The type of the model.

propertyName
String

The name of the property, or null if the model is not a property.

Returns

Metadata for a model.

Applies to

Produit Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1