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 模型不是属性。

返回

空元数据对象。

适用于