StuperUser
StuperUser

Reputation: 10850

What collection does excludeProperties parameter for TryUpdateModel refer to?

Does excludeProperties parameter in http://msdn.microsoft.com/en-us/library/dd492957.aspx exclude properties from the model or the values from the Request?

E.g.

If I wish to exclude Model.SomeProperty.SomeChildProperty which has a name attribute of "Model.SomeProperty.SomeChildProperty", should I pass
["SomeProperty"](name of the property on the model)
or
["Model.SomeProperty.SomeChildProperty"](name of the field in the Request form)

To exclude it from the udpate?

Upvotes: 0

Views: 329

Answers (1)

marcind
marcind

Reputation: 53183

The DefaultModelBinder will look at PropertyDescriptor.Name when filtering properties during model binding. You should use the model property name.

Upvotes: 2

Related Questions