MutableObjectModelBinder Class

Summary

[Microsoft.AspNet.Mvc.ModelBinding.IModelBinder]() implementation for binding complex values.

Syntax

public class MutableObjectModelBinder : IModelBinder

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.ModelBinding.MutableObjectModelBinder

Methods

BindModelAsync(Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext)
Arguments:
Return type:

System.Threading.Tasks.Task{Microsoft.AspNet.Mvc.ModelBinding.ModelBindingResult}

public virtual Task<ModelBindingResult> BindModelAsync(ModelBindingContext bindingContext)
CanUpdateProperty(Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata)

Gets an indication whether a property with the given <paramref name=”propertyMetadata” /> can be updated.

Arguments:
Return type:

System.Boolean

Returns:

<c>true</c> if the property can be updated; <c>false</c> otherwise.

protected virtual bool CanUpdateProperty(ModelMetadata propertyMetadata)
CreateModel(Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext)

Creates suitable [System.Object]() for given <paramref name=”bindingContext” />.

Arguments:
Return type:

System.Object

Returns:

An [System.Object]() compatible with [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext.ModelType]().

protected virtual object CreateModel(ModelBindingContext bindingContext)
EnsureModel(Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext)

Ensures [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext.Model]() is not <c>null</c> in given

<paramref name=”bindingContext” />.

Arguments:
protected virtual void EnsureModel(ModelBindingContext bindingContext)
GetMetadataForProperties(Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext)

Gets the collection of [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]() for properties this binder should update.

Arguments:
Return type:

System.Collections.Generic.IEnumerable{Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata}

Returns:

Collection of [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]() for properties this binder should update.

protected virtual IEnumerable<ModelMetadata> GetMetadataForProperties(ModelBindingContext bindingContext)
SetProperty(Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext, Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer, Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata, Microsoft.AspNet.Mvc.ModelBinding.ModelBindingResult)

Updates a property in the current [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext.Model]().

Arguments:
protected virtual void SetProperty(ModelBindingContext bindingContext, ModelExplorer modelExplorer, ModelMetadata propertyMetadata, ModelBindingResult dtoResult)