Commit Graph

11 Commits

Author SHA1 Message Date
Mugdha Kulkarni 933a13608f Adding fix for 2756 and test cases. Skipping the test cases for 2793. 2015-07-10 15:58:36 -07:00
Doug Bunting a170a4e1e4 Add `ModelBindingContext.IsFirstChanceBinding` and `IsTopLevelObject`
- 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
2015-06-24 09:17:29 -07:00
Hisham Abdullah Bin Ateya 1f9a451e2f Using 'nameof' operator instead of margic strings 2015-06-12 02:26:34 +03:00
Doug Bunting eefa582069 Address #2526; remove use of a required validator when validating `[BindRequired]`
- only use MVC error message when `[BindRequired]` is violated
- update that error message to more clearly describe the problem
- enable all tests skipped due to dupe bug #2493
- update expectations of a few tests using the old messages

nits:
- rename `ModelBinding_MissingRequiredMember` to `ModelBinding_MissingBindRequiredMember`
- remove `<param>` description of removed `requiredValidator` parameter
- remove unused `MutableObjectModelBinderTest.GetRequiredValidator()`
2015-06-05 16:56:05 -07:00
Doug Bunting 517c013882 React to aspnet/Razor#89 fix
- use `IDictionary<string, TValue>` support in `<a/>` and `<form/>` tag helpers
 - make `RouteValues` dictionaries `IDictionary<string, string>` for ease of use
- remove `TagHelperOutputExtensions.FindPrefixedAttributes()`
- set all `GeneratedTagHelperContext` properties
- add error for tag helper dictionary properties where `TValue` is `ModelExpression`
- add new `RazorPage.InvalidTagHelperIndexerAssignment()` method and resource

tests
- use new `isIndexer` argument when creating `TagHelperAttributeDescriptor`
- arrange `AnchorTagHelper` and `FormTagHelper` correctly
 - also expect `routeValues != null` in calls to `IHtmlGenerator`

nits:
- get rid of some `foo` and `bar` gunk in tests
- remove unused variable to cleanup a test compilation warning
2015-05-20 22:07:19 -07:00
Ryan Nowak fa56df93c3 Fix #2407 - Part 1 - Make model binding behavior for [Required] compatible
with MVC5.

This change removes the behavior in model binding to validate values 'on
the wire' for requiredness instead of the looking at the model. This
restores the behavior of [Required] for model binding to the MVC5
semantics.
2015-05-19 15:57:56 -07:00
Harsh Gupta 22f1881cc6 Restoring modelvalidation node. 2015-05-14 18:38:26 -07:00
Ryan Nowak 2fc983b23a Fix for #2414 - Remove [DefaultValue] support from ModelBinding
This part of the change removes default value support from ModelBinding.

Updated some unit tests to verify that it does nothing in that case.
Deleted a functional test as it was pure duplication of another
(supported) case where the property has a pre-initialized value.
2015-05-13 20:03:23 -07:00
Chris R bd03142dab React to Http namespace changes. 2015-05-07 15:19:10 -07:00
N. Taylor Mullen 64e726d2b2 Update LICENSE.txt and license header on files. 2015-05-01 13:55:25 -07:00
Ryan Nowak 9fded74b15 Merging ModelBinding into Mvc.Core 2015-04-27 02:10:37 -07:00