AssociatedMetadataProvider.CreateMetadata 方法

定义

在派生类中重写时,创建模型的元数据。

protected:
 abstract System::Web::ModelBinding::ModelMetadata ^ CreateMetadata(System::Collections::Generic::IEnumerable<Attribute ^> ^ attributes, Type ^ containerType, Func<System::Object ^> ^ modelAccessor, Type ^ modelType, System::String ^ propertyName);
protected abstract System.Web.ModelBinding.ModelMetadata CreateMetadata (System.Collections.Generic.IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName);
abstract member CreateMetadata : seq<Attribute> * Type * Func<obj> * Type * string -> System.Web.ModelBinding.ModelMetadata
Protected MustOverride Function CreateMetadata (attributes As IEnumerable(Of Attribute), containerType As Type, modelAccessor As Func(Of Object), modelType As Type, propertyName As String) As ModelMetadata

参数

attributes
IEnumerable<Attribute>

属性。

containerType
Type

如果没有容器,则为容器的类型或 null

modelAccessor
Func<Object>

模型访问器。

modelType
Type

模型的类型。

propertyName
String

属性的名称;如果该模型不是属性,则为 null

返回

模型的元数据。

适用于