共用方式為


ModelMetadataProvider.GetMetadataForProperty 方法

定義

取得指定之屬性的中繼資料。

public abstract System.Web.Mvc.ModelMetadata GetMetadataForProperty (Func<object> modelAccessor, Type containerType, string propertyName);
abstract member GetMetadataForProperty : Func<obj> * Type * string -> System.Web.Mvc.ModelMetadata
Public MustOverride Function GetMetadataForProperty (modelAccessor As Func(Of Object), containerType As Type, propertyName As String) As ModelMetadata

參數

modelAccessor
Func<Object>

模型存取子。

containerType
Type

容器的型別。

propertyName
String

要取得中繼資料模型的屬性。

傳回

ModelMetadata屬性的 物件。

適用於