ModelMetadataProviderExtensions Class¶
Methods¶
-
GetMetadataForProperty
(Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider, System.Type, System.String)¶ Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]() for property identified by the provided
<paramref name=”containerType” /> and <paramref name=”propertyName” />.
Arguments: - provider (Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().
- containerType (System.Type) – The [System.Type]() for which the property is defined.
- propertyName (System.String) – The property name.
Return type: Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata
Returns: A [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]() for the property.
public static ModelMetadata GetMetadataForProperty(IModelMetadataProvider provider, Type containerType, string propertyName)
-
GetModelExplorerForType
(Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider, System.Type, System.Object)¶ Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer]() for the provided <paramref name=”modelType” /> and
<paramref name=”model” />.
Arguments: - provider (Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider) – The [Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider]().
- modelType (System.Type) – The declared [System.Type]() of the model object.
- model (System.Object) – The model object.
Return type: Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer
public static ModelExplorer GetModelExplorerForType(IModelMetadataProvider provider, Type modelType, object model)
-