Commit Graph

13 Commits

Author SHA1 Message Date
Ryan Nowak 8a502dbe5d Rewrite of validation 2015-09-25 16:56:42 -07:00
Ryan Nowak a318c4599a API Review - Split up .Actions
Abstractions - Core MVC extensibility

Controllers - MVC implementations of .Abstractions and supporting
contracts

Infrastructure - General purpose support APIs. Metadata APIs that don't
fit clearly with a feature or with .Abstraction
2015-09-21 21:54:02 -07:00
Ryan Nowak 076ce6a8a1 Make ModelBindingResult a struct. 2015-09-03 12:52:50 -07:00
Ryan Nowak 229724c4ea Reorganize MVC namespaces 2015-09-01 22:28:33 -07:00
Doug Bunting 829a5c9046 Expand model types `GenericModelBinder` can handle
- #2993
- use `ClosedGenericMatcher` to handle e.g. non-generic model types implementing requested interfaces
- reduce `IsAssignableFrom()` use since created binders use explicit casts i.e. handle explicit implementations
- also add more integration tests covering various collection key formats, some with validation errors
  - merge a few `[Fact]`s into `[Theory]`s
2015-08-25 09:50:31 -07:00
Ryan Nowak 6d365e9a32 Make ValueProviderResult a string-ish struct 2015-08-21 11:02:40 -07:00
Doug Bunting 79a2982441 Add support for model binding dictionaries from `prefix[name]=value` entries
- #1418
- add new fallback binding in `DictionaryModelBinder`
 - similar to MVC 5 approach but more explicit and with better key conversion support
- fix bugs in `PrefixContainer` encountered while adding new tests of #1418 scenarios
 - did not handle entries like "[key]" or "prefix.key[index]" correctly
 - refactor part of `GetKeyFromEmptyPrefix()` into `IndexOfDelimiter()`; share with `GetKeyFromNonEmptyPrefix()`
 - extend `ReadableStringCollectionValueProviderTest` to cover bracketed key segments

nits:
- remove use of "foo", "bar", and "baz" in affected test classes
- `""` -> `string.Empty`
- `vpResult` -> `result`
2015-07-20 16:33:35 -07:00
Ryan Nowak 6e1226bfe4 Enable tests for #2470
This was very likely fixed as part of
22f1881cc6
2015-05-28 14:57:50 -07:00
Ryan Nowak 8f38650d1f Fix #1579 - Bind top-level collections as an empty collection
This change treats 'top-level' collection-type models similarly to
top-level POCO model - namely that they will always be instantiated even
if there's no data to put inside.
2015-05-21 22:46:04 -07:00
Harsh Gupta 88ac4b94e4 Fixing #2466, #2446.
The assumption is ModelState should have entries if
1. An error is explicitly added by a model binder.
2. There is validation error reported while validating the model.
3. There is value bound by the model binder.

With this change there should be no extra entry other than for the cases mentioned above.

Also enabling the integration test cases.
2015-05-15 12:27:41 -07:00
Harsh Gupta 502b832d17 Integration tests for
Collection Model Binder -> MutableObject(POCO) Model Binder – With-Data/Fallback-to-empty-prefix/Without-Data
2015-05-04 09:52:15 -07:00
N. Taylor Mullen 64e726d2b2 Update LICENSE.txt and license header on files. 2015-05-01 13:55:25 -07:00
Ryan Nowak f77bb0ed2f GenericModelBinder integration tests part 1
- Covers simple scenario for each model binder.
- Covers scenarios mixing a generic model binder with a greedy model
  binder.
2015-04-28 17:43:29 -07:00