MutableObjectModelBinder Class¶
Summary¶
[Microsoft.AspNet.Mvc.ModelBinding.IModelBinder]() implementation for binding complex values.
Methods¶
-
BindModelAsync
(Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext)¶ Arguments: - bindingContext (Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext) –
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: - propertyMetadata (Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata) – [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]() for the property of interest.
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: - bindingContext (Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext]().
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: - bindingContext (Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext]().
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: - bindingContext (Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext]().
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: - bindingContext (Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingContext]().
- modelExplorer (Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelExplorer]() for the model containing property to set.
- propertyMetadata (Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]() for the property to set.
- dtoResult (Microsoft.AspNet.Mvc.ModelBinding.ModelBindingResult) – The [Microsoft.AspNet.Mvc.ModelBinding.ModelBindingResult]() for the property’s new value.
protected virtual void SetProperty(ModelBindingContext bindingContext, ModelExplorer modelExplorer, ModelMetadata propertyMetadata, ModelBindingResult dtoResult)
-