共用方式為


EmptyModelMetadataProvider.CreateMetadata Method

Creates a new instance of the ModelMetadata class.

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

Syntax

'Declaration
Protected Overrides Function CreateMetadata ( _
    attributes As IEnumerable(Of Attribute), _
    containerType As Type, _
    modelAccessor As Func(Of Object), _
    modelType As Type, _
    propertyName As String _
) As ModelMetadata
protected override ModelMetadata CreateMetadata(
    IEnumerable<Attribute> attributes,
    Type containerType,
    Func<Object> modelAccessor,
    Type modelType,
    string propertyName
)
protected:
virtual ModelMetadata^ CreateMetadata(
    IEnumerable<Attribute^>^ attributes, 
    Type^ containerType, 
    Func<Object^>^ modelAccessor, 
    Type^ modelType, 
    String^ propertyName
) override

Parameters

  • containerType
    Type: System.Type
    The type of the container.

Return Value

Type: System.Web.Mvc.ModelMetadata
An empty instance of the model metadata.

Remarks

The MVC framework requires metadata for the model. The class provides an empty metadata model.

See Also

Reference

EmptyModelMetadataProvider Class

System.Web.Mvc Namespace