ModelMetadataProvider.GetMetadataForProperty(PropertyInfo, Type) 方法

定义

提供描述属性的元数据。

public:
 virtual Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ GetMetadataForProperty(System::Reflection::PropertyInfo ^ propertyInfo, Type ^ modelType);
public virtual Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata GetMetadataForProperty (System.Reflection.PropertyInfo propertyInfo, Type modelType);
abstract member GetMetadataForProperty : System.Reflection.PropertyInfo * Type -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata
override this.GetMetadataForProperty : System.Reflection.PropertyInfo * Type -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata
Public Overridable Function GetMetadataForProperty (propertyInfo As PropertyInfo, modelType As Type) As ModelMetadata

参数

propertyInfo
PropertyInfo

PropertyInfo

modelType
Type

实际模型类型。

返回

描述 ModelMetadatapropertyInfo实例。

适用于