Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetMetadataForProperty Method (Func(Object), Type, String)

AssociatedMetadataProvider.GetMetadataForProperty Method (Func<Object>, Type, String)

.NET Framework 4.6 and 4.5

When overridden in a derived class, returns metadata for a property specified by a property name.

Namespace:  System.Web.ModelBinding
Assembly:  System.Web (in System.Web.dll)

public override ModelMetadata GetMetadataForProperty(
	Func<Object> modelAccessor,
	Type containerType,
	string propertyName
)

Parameters

modelAccessor
Type: System.Func<Object>

The model accessor.

containerType
Type: System.Type

The type of the container.

propertyName
Type: System.String

The name of the property.

Return Value

Type: System.Web.ModelBinding.ModelMetadata
Metadata for the specified property.

ExceptionCondition
ArgumentNullException

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.

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft