ModelExplorer Class

Summary

Associates a model object with it’s corresponding [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata](Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata.yml).

Syntax

public class ModelExplorer

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Constructors

ModelExplorer(Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider, Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata, System.Func<System.Object, System.Object>)

Creates a new [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

Arguments:
public ModelExplorer(IModelMetadataProvider metadataProvider, ModelExplorer container, ModelMetadata metadata, Func<object, object> modelAccessor)
ModelExplorer(Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider, Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata, System.Object)

Creates a new [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

Arguments:
public ModelExplorer(IModelMetadataProvider metadataProvider, ModelExplorer container, ModelMetadata metadata, object model)
ModelExplorer(Microsoft.AspNet.Mvc.ModelBinding.IModelMetadataProvider, Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata, System.Object)

Creates a new [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

Arguments:
public ModelExplorer(IModelMetadataProvider metadataProvider, ModelMetadata metadata, object model)

Properties

Container()

Gets the container [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

Return type:Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer
public ModelExplorer Container { get; }
Metadata()

Gets the [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata](Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata.yml).

Return type:Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata
public ModelMetadata Metadata { get; }
Model()

Gets the model object.

Return type:System.Object
public object Model { get; }
ModelType()
Return type:System.Type
public Type ModelType { get; }
Properties()

Gets the properties.

Return type:System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer}
public IEnumerable<ModelExplorer> Properties { get; }

Methods

GetExplorerForExpression(Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata, System.Func<System.Object, System.Object>)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the provided model value and model [System.Type]().

Arguments:
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

public ModelExplorer GetExplorerForExpression(ModelMetadata metadata, Func<object, object> modelAccessor)
GetExplorerForExpression(Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata, System.Object)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the provided model value and model [System.Type]().

Arguments:
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

public ModelExplorer GetExplorerForExpression(ModelMetadata metadata, object model)
GetExplorerForExpression(System.Type, System.Func<System.Object, System.Object>)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the provided model value and model [System.Type]().

Arguments:
  • modelType (System.Type) – The model [System.Type]().
  • modelAccessor (System.Func{System.Object,System.Object}) –
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

public ModelExplorer GetExplorerForExpression(Type modelType, Func<object, object> modelAccessor)
GetExplorerForExpression(System.Type, System.Object)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the provided model value and model [System.Type]().

Arguments:
  • modelType (System.Type) – The model [System.Type]().
  • model (System.Object) – The model value.
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

public ModelExplorer GetExplorerForExpression(Type modelType, object model)
GetExplorerForModel(System.Object)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the given <paramref name=”model” /> value.

Arguments:
  • model (System.Object) – The model value.
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml).

public ModelExplorer GetExplorerForModel(object model)
GetExplorerForProperty(System.String)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the property with given <paramref name=”name” />, or <c>null</c> if the property cannot be found.

Arguments:
  • name (System.String) – The property name.
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml), or <c>null</c>.

public ModelExplorer GetExplorerForProperty(string name)
GetExplorerForProperty(System.String, System.Func<System.Object, System.Object>)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the property with given <paramref name=”name” />, or <c>null</c> if the property cannot be found.

Arguments:
  • name (System.String) – The property name.
  • modelAccessor (System.Func{System.Object,System.Object}) – An accessor for the model value.
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml), or <c>null</c>.

public ModelExplorer GetExplorerForProperty(string name, Func<object, object> modelAccessor)
GetExplorerForProperty(System.String, System.Object)

Gets a [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml) for the property with given <paramref name=”name” />, or <c>null</c> if the property cannot be found.

Arguments:
  • name (System.String) – The property name.
  • model (System.Object) – The model value.
Return type:

Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer

Returns:

A [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer](Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer.yml), or <c>null</c>.

public ModelExplorer GetExplorerForProperty(string name, object model)