共用方式為


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

顯示資料行屬性。

適用於