Controller::UpdateModel<TModel> Method
[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Updates the specified model instance using values from the controller's current value provider.
| Name | Description | |
|---|---|---|
|
UpdateModel<TModel>(TModel) | Updates the specified model instance using values from the controller's current value provider. |
|
UpdateModel<TModel>(TModel, String) | Updates the specified model instance using values from the controller's current value provider and a prefix. |
|
UpdateModel<TModel>(TModel, array<String>) | Updates the specified model instance using values from the controller object's current value provider. |
|
UpdateModel<TModel>(TModel, IValueProvider) | Updates the specified model instance using values from the value provider. |
|
UpdateModel<TModel>(TModel, String, array<String>) | Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. |
|
UpdateModel<TModel>(TModel, String, IValueProvider) | Updates the specified model instance using values from the value provider and a prefix. |
|
UpdateModel<TModel>(TModel, array<String>, IValueProvider) | Updates the specified model instance using values from the value provider, a prefix, and included properties. |
|
UpdateModel<TModel>(TModel, String, array<String>, array<String>) | Updates the specified model instance using values from the controller's current value provider, a prefix, excluded properties, and included properties. |
|
UpdateModel<TModel>(TModel, String, array<String>, IValueProvider) | Updates the specified model instance using values from the value provider, a prefix, and included properties. |
|
UpdateModel<TModel>(TModel, String, array<String>, array<String>, IValueProvider) | Updates the specified model instance using values from the value provider, a prefix, excluded properties, and included properties. |
You do not have to explicitly specify the generic parameter TModel. Instead, you can let the C# or Visual Basic type inference engine determine the generic parameter TModel by omitting it.
The TryUpdateModel<TModel> method is like the UpdateModel<TModel> method except that the TryUpdateModel<TModel> method does not throw an InvalidOperationException exception if the updated model state is not valid.
Security Note
|
|---|
|
Use one of the TryUpdateModel<TModel> methods that takes either a list of included properties (a whitelist) or a list of excluded properties (a blacklist). If no explicit whitelist or blacklist is passed, the TryUpdateModel<TModel> method tries to update every public property of your model for which there is a corresponding value in the request. A malicious user could exploit this in order to update properties that you do not intend to provide access to. |