次の方法で共有


AssociatedMetadataProvider<TModelMetadata>.GetMetadataForProperty Method

Retrieves the metadata for the specified property using the container type and property name.

Namespace:  System.Web.Http.Metadata.Providers
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Public Overrides NotOverridable Function GetMetadataForProperty ( _
    modelAccessor As Func(Of Object), _
    containerType As Type, _
    propertyName As String _
) As ModelMetadata
'Usage
Dim instance As AssociatedMetadataProvider 
Dim modelAccessor As Func(Of Object)
Dim containerType As Type 
Dim propertyName As String 
Dim returnValue As ModelMetadata 

returnValue = instance.GetMetadataForProperty(modelAccessor, _
    containerType, propertyName)
public override sealed ModelMetadata GetMetadataForProperty(
    Func<Object> modelAccessor,
    Type containerType,
    string propertyName
)
public:
virtual ModelMetadata^ GetMetadataForProperty(
    Func<Object^>^ modelAccessor, 
    Type^ containerType, 
    String^ propertyName
) override sealed
abstract GetMetadataForProperty : 
        modelAccessor:Func<Object> * 
        containerType:Type * 
        propertyName:string -> ModelMetadata  
override GetMetadataForProperty : 
        modelAccessor:Func<Object> * 
        containerType:Type * 
        propertyName:string -> ModelMetadata
public override final function GetMetadataForProperty(
    modelAccessor : Func<Object>, 
    containerType : Type, 
    propertyName : String
) : ModelMetadata

Parameters

  • containerType
    Type: System.Type

    The type of the container.

Return Value

Type: System.Web.Http.Metadata.ModelMetadata
The metadata for the specified property.

See Also

Reference

AssociatedMetadataProvider<TModelMetadata> Class

System.Web.Http.Metadata.Providers Namespace