This repository was archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
A POCO parameter with an exact name match in a value provider fails to model bind #1865
Comments
dougbu
added a commit
that referenced
this issue
Mar 16, 2015
- #1865 - pass indication through to `CompositeModelBinder` in `ModelBindingResult` - use in `CompositeModelBinder` to detect another fallback case nit: also clean up `ModelBindingResult` doc comments
dougbu
added a commit
that referenced
this issue
Mar 18, 2015
- #1865 - pass indication through to `CompositeModelBinder` in `ModelBindingResult` - use in `CompositeModelBinder` to detect another fallback case nit: also clean up `ModelBindingResult` doc comments
dougbu
added a commit
that referenced
this issue
Mar 18, 2015
- revert most of previous fix attempt (leaving doc comment updates) - change `MutableObjectModelBinder` to ignore exact match in value providers - had an incorrect assumption: don't want exact model name to match since this binder supports only complex objects - ignored `BinderModelName`, value provider filtering, et cetera - reduces over-binding e.g. `[Required]` validation within missing properties
original bug is better described in #2129. changing the subject to make it clear the |
Model
and a parameter named model
fails to model bind
Model
and a parameter named model
fails to model bind
realized the "top-level property" in the subject was a bit misleading and have updated the subject again. problems occur when an action parameter's name is an exact match for something in the value providers. so the previously-mentioned property must have a value in the query, form, etc. to cause problems. also edited the issue description to remove mention of collections. |
dougbu
added a commit
that referenced
this issue
Mar 19, 2015
- #1865 - pass indication through to `CompositeModelBinder` in `ModelBindingResult` - use in `CompositeModelBinder` to detect another fallback case nit: also clean up `ModelBindingResult` doc comments
dougbu
added a commit
that referenced
this issue
Mar 19, 2015
- revert most of previous fix attempt (leaving doc comment updates) - change `MutableObjectModelBinder` to ignore exact match in value providers - had an incorrect assumption: don't want exact model name to match since this binder supports only complex objects - ignored `BinderModelName`, value provider filtering, et cetera - reduces over-binding e.g. `[Required]` validation within missing properties
dougbu
added a commit
that referenced
this issue
Mar 20, 2015
- #1865 - pass indication through to `CompositeModelBinder` in `ModelBindingResult` - use in `CompositeModelBinder` to detect another fallback case nit: also clean up `ModelBindingResult` doc comments
dougbu
added a commit
that referenced
this issue
Mar 20, 2015
- revert most of previous fix attempt (leaving doc comment updates) - change `MutableObjectModelBinder` to ignore exact match in value providers - had an incorrect assumption: don't want exact model name to match since this binder supports only complex objects - ignored `BinderModelName`, value provider filtering, et cetera - reduces over-binding e.g. `[Required]` validation within missing properties
dougbu
added a commit
that referenced
this issue
Mar 20, 2015
…e match - #1865 - change `MutableObjectModelBinder` to ignore exact match in value providers - had an incorrect assumption: don't want exact model name to match since this binder supports only complex objects - also ignored `BinderModelName`, value provider filtering, et cetera - reduces over-binding e.g. `[Required]` validation within missing properties also add more tests of #2129 scenarios
commit 533474d |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
when POCO model contains a property with the same name as the parameter e.g.
then
model
will not be initialized -- all properties have default values. rename theModel
property ormodel
parameter and everything works as expected.because the problem relates to model binders falling back to the empty prefix, can workaround it: send field names prefixed with the parameter name e.g.
bug does not appear to be a regression from MVC 5.2, MVC 6 Beta1, or MVC 6 Beta2.
The text was updated successfully, but these errors were encountered: