AssociatedMetadataProvider.GetMetadataForProperty Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When overridden in a derived class, returns metadata for a specified property.
Overloads
GetMetadataForProperty(Func<Object>, Type, PropertyDescriptor) |
When overridden in a derived class, returns metadata for a property specified by a property descriptor object. |
GetMetadataForProperty(Func<Object>, Type, String) |
When overridden in a derived class, returns metadata for a property specified by a property name. |
GetMetadataForProperty(Func<Object>, Type, PropertyDescriptor)
When overridden in a derived class, returns metadata for a property specified by a property descriptor object.
protected:
virtual System::Web::ModelBinding::ModelMetadata ^ GetMetadataForProperty(Func<System::Object ^> ^ modelAccessor, Type ^ containerType, System::ComponentModel::PropertyDescriptor ^ propertyDescriptor);
protected virtual System.Web.ModelBinding.ModelMetadata GetMetadataForProperty (Func<object> modelAccessor, Type containerType, System.ComponentModel.PropertyDescriptor propertyDescriptor);
override this.GetMetadataForProperty : Func<obj> * Type * System.ComponentModel.PropertyDescriptor -> System.Web.ModelBinding.ModelMetadata
Protected Overridable Function GetMetadataForProperty (modelAccessor As Func(Of Object), containerType As Type, propertyDescriptor As PropertyDescriptor) As ModelMetadata
Parameters
- containerType
- Type
The type of the container.
- propertyDescriptor
- PropertyDescriptor
The property descriptor.
Returns
Metadata for the specified property.
Applies to
GetMetadataForProperty(Func<Object>, Type, String)
When overridden in a derived class, returns metadata for a property specified by a property name.
public:
override System::Web::ModelBinding::ModelMetadata ^ GetMetadataForProperty(Func<System::Object ^> ^ modelAccessor, Type ^ containerType, System::String ^ propertyName);
public override System.Web.ModelBinding.ModelMetadata GetMetadataForProperty (Func<object> modelAccessor, Type containerType, string propertyName);
override this.GetMetadataForProperty : Func<obj> * Type * string -> System.Web.ModelBinding.ModelMetadata
Public Overrides Function GetMetadataForProperty (modelAccessor As Func(Of Object), containerType As Type, propertyName As String) As ModelMetadata
Parameters
- containerType
- Type
The type of the container.
- propertyName
- String
The name of the property.
Returns
Metadata for the specified property.
Exceptions
The containerType
parameter is null
.
-or-
The propertyName
parameter is null
or empty.
-or-
A property that has the name specified by propertyName
cannot be found in the containerType
type.
Applies to
.NET