This repository has been 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
Model State should have values for greedy model binders as well. #2445
Comments
Based on the tests that are disabled with this bug as the reason, problem is much more broad. All values bound from user input should have |
dougbu
added a commit
that referenced
this issue
Jun 14, 2015
…istent - part I of II for #2445 (with a duplicate code PR to follow) - needed for #2445 because new `ModelState` entries for values will make inconsisteny worse - change `BodyModelBinder` to use same keys for all `ModelBindingResult`s and `ModelState` entries - return fatal error result if formatter adds an error to `ModelState` - update potential callers to avoid avoid ignoring `IsFatalError` - fix test attempting to serialize all of `ModelState` - will be borked with additional `RawValue`s in state - fix two other tests that serialized `ModelState` but checked only `IsValid` nits: - address minor inconsistencies in `ModelBindingContext` - use `System.Reflection.Extensions` package a bit more, where it's already referenced - remove some unused resources
dougbu
added a commit
that referenced
this issue
Jun 14, 2015
- cleanup duplicate code now that #2445 is fixed - update unit tests using old `ModelBindingContext` setups - fix (just) one integration test where `MutableObjectModelBinder` incorrectly calculated `isTopLevelObject` and returned a non-`null` model - undo temporary changes in `BodyModelBinderTests` due to increased reliance on incorrect `isTopLevelObject` in #2445 fix nits: - combine tests that are now duplicates - beef up coverage of some `MutableObjectModelBinderTest` cases
dougbu
added a commit
that referenced
this issue
Jun 21, 2015
…istent - part I of II for #2445 (with a duplicate code PR to follow) - needed for #2445 because new `ModelState` entries for values will make inconsisteny worse - change `BodyModelBinder` to use same keys for all `ModelBindingResult`s and `ModelState` entries - return fatal error result if formatter adds an error to `ModelState` - update potential callers to avoid avoid ignoring `IsFatalError` - fix test attempting to serialize all of `ModelState` - will be borked with additional `RawValue`s in state - fix two other tests that serialized `ModelState` but checked only `IsValid` nits: - address minor inconsistencies in `ModelBindingContext` - use `System.Reflection.Extensions` package a bit more, where it's already referenced - remove some unused resources
dougbu
added a commit
that referenced
this issue
Jun 22, 2015
- cleanup duplicate code now that #2445 is fixed - update unit tests using old `ModelBindingContext` setups - fix (just) one integration test where `MutableObjectModelBinder` incorrectly calculated `isTopLevelObject` and returned a non-`null` model - undo temporary changes in `BodyModelBinderTests` due to increased reliance on incorrect `isTopLevelObject` in #2445 fix nits: - combine tests that are now duplicates - beef up coverage of some `MutableObjectModelBinderTest` cases
dougbu
added a commit
that referenced
this issue
Jun 24, 2015
- part II of II for #2445 - `FormCollectionModelBinder` is an exception because container is not user-provided - no `ModelState` entry added - enable tests that #2445 was blocking - fix these and other tests expecting different `ModelState` entries - simplify logic in `FormFileModelBinder` `ValueProviderResult` - remove `protected` setters and parameterless constructor - no scenario for their use in subclasses; however `ConvertTo()` remains `virtual` - add single-parameter constructor - use in most of the greedy and type-matching model binders - add doc comments throughout class nits: - use new `ValueProviderResult` constructor in many existing tests - `""` -> `string.Empty` and `vpr` -> `valueProviderResult` in `ValueProviderResultTest` - improve some test names in `BodyValidationIntegrationTests` - do not check `Message` of a Json.NET `Exception`
dougbu
added a commit
that referenced
this issue
Jun 24, 2015
- cleanup duplicate code now that #2445 is fixed - update unit tests using old `ModelBindingContext` setups - fix (just) one integration test where `MutableObjectModelBinder` incorrectly calculated `isTopLevelObject` and returned a non-`null` model - undo temporary changes in `BodyModelBinderTests` due to increased reliance on incorrect `isTopLevelObject` in #2445 fix nits: - combine tests that are now duplicates - beef up coverage of some `MutableObjectModelBinderTest` cases - remove unused `using`s
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently HeaderModelBinder and BodyModelBinder do not populate the model state by calling
SetModelValue
, for success cases. This means we cannot do a ajax post which uses the populated value.The text was updated successfully, but these errors were encountered: