DataAnnotationsModelMetadata(DataAnnotationsModelMetadataProvider, Type, Func<Object>, Type, String, DisplayColumnAttribute) 构造函数

定义

初始化 DataAnnotationsModelMetadata 类的新实例。Initializes a new instance of the DataAnnotationsModelMetadata class.

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

提供程序对象。The provider object.

containerType
Type

如果没有容器,则为容器的类型或 nullThe type of the container, or null if there is no container.

modelAccessor
Func<Object>

模型访问器。The model accessor.

modelType
Type

模型的类型。The type of the model.

propertyName
String

属性的名称;如果该模型不是属性,则为 nullThe name of the property, or null if the model is not a property.

displayColumnAttribute
DisplayColumnAttribute

显示列特性。The display column attribute.

适用于