DataAnnotationsModelMetadata 构造函数

定义

初始化 DataAnnotationsModelMetadata 类的新实例。

public:
 DataAnnotationsModelMetadata(System::Web::ModelBinding::DataAnnotationsModelMetadataProvider ^ provider, Type ^ containerType, Func<System::Object ^> ^ modelAccessor, Type ^ modelType, System::String ^ propertyName, System::ComponentModel::DataAnnotations::DisplayColumnAttribute ^ displayColumnAttribute);
public DataAnnotationsModelMetadata (System.Web.ModelBinding.DataAnnotationsModelMetadataProvider provider, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName, System.ComponentModel.DataAnnotations.DisplayColumnAttribute displayColumnAttribute);
new System.Web.ModelBinding.DataAnnotationsModelMetadata : System.Web.ModelBinding.DataAnnotationsModelMetadataProvider * Type * Func<obj> * Type * string * System.ComponentModel.DataAnnotations.DisplayColumnAttribute -> System.Web.ModelBinding.DataAnnotationsModelMetadata
Public Sub New (provider As DataAnnotationsModelMetadataProvider, containerType As Type, modelAccessor As Func(Of Object), modelType As Type, propertyName As String, displayColumnAttribute As DisplayColumnAttribute)

参数

provider
DataAnnotationsModelMetadataProvider

提供程序对象。

containerType
Type

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

modelAccessor
Func<Object>

模型访问器。

modelType
Type

模型的类型。

propertyName
String

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

displayColumnAttribute
DisplayColumnAttribute

显示列特性。

适用于