共用方式為


AssociatedMetadataProvider.CreateMetadata 方法

定義

在衍生類別中覆寫時,建立模型的中繼資料。

protected:
 abstract System::Web::ModelBinding::ModelMetadata ^ CreateMetadata(System::Collections::Generic::IEnumerable<Attribute ^> ^ attributes, Type ^ containerType, Func<System::Object ^> ^ modelAccessor, Type ^ modelType, System::String ^ propertyName);
protected abstract System.Web.ModelBinding.ModelMetadata CreateMetadata (System.Collections.Generic.IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName);
abstract member CreateMetadata : seq<Attribute> * Type * Func<obj> * Type * string -> System.Web.ModelBinding.ModelMetadata
Protected MustOverride 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(如果該模型不是一個屬性)。

傳回

模型的中繼資料。

適用於