EmptyModelMetadataProvider.CreateMetadata 方法

定义

创建 ModelMetadata 类的新实例。

protected:
 override System::Web::ModelBinding::ModelMetadata ^ CreateMetadata(System::Collections::Generic::IEnumerable<Attribute ^> ^ attributes, Type ^ containerType, Func<System::Object ^> ^ modelAccessor, Type ^ modelType, System::String ^ propertyName);
protected override System.Web.ModelBinding.ModelMetadata CreateMetadata (System.Collections.Generic.IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName);
override this.CreateMetadata : seq<Attribute> * Type * Func<obj> * Type * string -> System.Web.ModelBinding.ModelMetadata
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

参数

attributes
IEnumerable<Attribute>

属性。

containerType
Type

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

modelAccessor
Func<Object>

模型访问器。

modelType
Type

模型的类型。

propertyName
String

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

返回

ModelMetadata

一个空的元数据对象。

适用于