Controller.TryUpdateModel Method

Definition

Overloads

TryUpdateModel<TModel>(TModel, String, String[], IValueProvider)

Updates the specified model instance using values from the value provider, a prefix, and included properties.

TryUpdateModel<TModel>(TModel, String, String[], String[])

Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include.

TryUpdateModel<TModel>(TModel, String[], IValueProvider)

Updates the specified model instance using values from the value provider and a list of properties to include.

TryUpdateModel<TModel>(TModel, String, IValueProvider)

Updates the specified model instance using values from the value provider and a list of properties to include.

TryUpdateModel<TModel>(TModel, String, String[])

Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties.

TryUpdateModel<TModel>(TModel, IValueProvider)

Updates the specified model instance using values from the value provider.

TryUpdateModel<TModel>(TModel, String, String[], String[], IValueProvider)

Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include.

TryUpdateModel<TModel>(TModel, String)

Updates the specified model instance using values from the controller's current value provider and a prefix.

TryUpdateModel<TModel>(TModel)

Updates the specified model instance using values from the controller's current value provider.

TryUpdateModel<TModel>(TModel, String[])

Updates the specified model instance using values from the controller's current value provider and included properties.

TryUpdateModel<TModel>(TModel, String, String[], IValueProvider)

Updates the specified model instance using values from the value provider, a prefix, and included properties.

protected internal bool TryUpdateModel<TModel> (TModel model, string prefix, string[] includeProperties, System.Web.Mvc.IValueProvider valueProvider) where TModel : class;
member this.TryUpdateModel : 'Model * string * string[] * System.Web.Mvc.IValueProvider -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, prefix As String, includeProperties As String(), valueProvider As IValueProvider) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

prefix
String

The prefix to use when looking up values in the value provider.

includeProperties
String[]

A list of properties of the model to update.

valueProvider
IValueProvider

A dictionary of values that is used to update the model.

Returns

true if the update is successful; otherwise, false.

Applies to

TryUpdateModel<TModel>(TModel, String, String[], String[])

Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include.

protected internal bool TryUpdateModel<TModel> (TModel model, string prefix, string[] includeProperties, string[] excludeProperties) where TModel : class;
member this.TryUpdateModel : 'Model * string * string[] * string[] -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, prefix As String, includeProperties As String(), excludeProperties As String()) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

prefix
String

The prefix to use when looking up values in the value provider.

includeProperties
String[]

A list of properties of the model to update.

excludeProperties
String[]

A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list.

Returns

true if the update is successful; otherwise, false.

Exceptions

The model parameter or the ValueProvider property is null.

Applies to

TryUpdateModel<TModel>(TModel, String[], IValueProvider)

Updates the specified model instance using values from the value provider and a list of properties to include.

protected internal bool TryUpdateModel<TModel> (TModel model, string[] includeProperties, System.Web.Mvc.IValueProvider valueProvider) where TModel : class;
member this.TryUpdateModel : 'Model * string[] * System.Web.Mvc.IValueProvider -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, includeProperties As String(), valueProvider As IValueProvider) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

includeProperties
String[]

A list of properties of the model to update.

valueProvider
IValueProvider

A dictionary of values that is used to update the model.

Returns

true if the update is successful; otherwise, false.

Applies to

TryUpdateModel<TModel>(TModel, String, IValueProvider)

Updates the specified model instance using values from the value provider and a list of properties to include.

protected internal bool TryUpdateModel<TModel> (TModel model, string prefix, System.Web.Mvc.IValueProvider valueProvider) where TModel : class;
member this.TryUpdateModel : 'Model * string * System.Web.Mvc.IValueProvider -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, prefix As String, valueProvider As IValueProvider) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

prefix
String

A list of properties of the model to update.

valueProvider
IValueProvider

A dictionary of values that is used to update the model.

Returns

true if the update is successful; otherwise, false.

Applies to

TryUpdateModel<TModel>(TModel, String, String[])

Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties.

protected internal bool TryUpdateModel<TModel> (TModel model, string prefix, string[] includeProperties) where TModel : class;
member this.TryUpdateModel : 'Model * string * string[] -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, prefix As String, includeProperties As String()) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

prefix
String

The prefix to use when looking up values in the value provider.

includeProperties
String[]

A list of properties of the model to update.

Returns

true if the update is successful; otherwise, false.

Exceptions

The model parameter or the ValueProvider property is null.

Applies to

TryUpdateModel<TModel>(TModel, IValueProvider)

Updates the specified model instance using values from the value provider.

protected internal bool TryUpdateModel<TModel> (TModel model, System.Web.Mvc.IValueProvider valueProvider) where TModel : class;
member this.TryUpdateModel : 'Model * System.Web.Mvc.IValueProvider -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, valueProvider As IValueProvider) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

valueProvider
IValueProvider

A dictionary of values that is used to update the model.

Returns

true if the update is successful; otherwise, false.

Applies to

TryUpdateModel<TModel>(TModel, String, String[], String[], IValueProvider)

Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include.

protected internal bool TryUpdateModel<TModel> (TModel model, string prefix, string[] includeProperties, string[] excludeProperties, System.Web.Mvc.IValueProvider valueProvider) where TModel : class;
member this.TryUpdateModel : 'Model * string * string[] * string[] * System.Web.Mvc.IValueProvider -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, prefix As String, includeProperties As String(), excludeProperties As String(), valueProvider As IValueProvider) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

prefix
String

The prefix to use when looking up values in the value provider.

includeProperties
String[]

A list of properties of the model to update.

excludeProperties
String[]

A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list.

valueProvider
IValueProvider

A dictionary of values that is used to update the model.

Returns

true if the update is successful; otherwise, false.

Applies to

TryUpdateModel<TModel>(TModel, String)

Updates the specified model instance using values from the controller's current value provider and a prefix.

protected internal bool TryUpdateModel<TModel> (TModel model, string prefix) where TModel : class;
member this.TryUpdateModel : 'Model * string -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, prefix As String) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

prefix
String

The prefix to use when looking up values in the value provider.

Returns

true if the update is successful; otherwise, false.

Exceptions

The model parameter or the ValueProvider property is null.

Applies to

TryUpdateModel<TModel>(TModel)

Updates the specified model instance using values from the controller's current value provider.

protected internal bool TryUpdateModel<TModel> (TModel model) where TModel : class;
member this.TryUpdateModel : 'Model -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

Returns

true if the update is successful; otherwise, false.

Exceptions

The model parameter or the ValueProvider property is null.

Applies to

TryUpdateModel<TModel>(TModel, String[])

Updates the specified model instance using values from the controller's current value provider and included properties.

protected internal bool TryUpdateModel<TModel> (TModel model, string[] includeProperties) where TModel : class;
member this.TryUpdateModel : 'Model * string[] -> bool (requires 'Model : null)
Protected Friend Function TryUpdateModel(Of TModel As Class) (model As TModel, includeProperties As String()) As Boolean

Type Parameters

TModel

The type of the model object.

Parameters

model
TModel

The model instance to update.

includeProperties
String[]

A list of properties of the model to update.

Returns

true if the update is successful; otherwise, false.

Applies to