Commit Graph

13 Commits

Author SHA1 Message Date
Nate McMaster 3a710c3d64 Upgrade to xunit 2.3.0-beta4 2017-08-17 10:45:03 -07:00
Kiran Challa 842d661ac2 [Fixes #5698] Regression in 1.1 model binding for model types without default constructor
- Also reverts "Check for default constructor in ComplexTypeModelBinderProvider" commit d09e921c4a.
2017-02-10 11:10:02 -08:00
Kiran Challa ac98417398 ModelBinding: Remove IsReadOnly checks and add/update tests 2016-08-04 14:20:23 -07:00
Ryan Brandenburg 941da9264b Move ModelBindingHelper to Internal (#4664) 2016-05-18 16:52:43 -07:00
Ryan Nowak 4d63ffa879 Make ValueProvider creation lazy
We want this change to avoid MVC eagerly reading the form. This is good
for general perf and also for scenarios where you want read the body
yourself (large file uploads).

We DO have scenarios where you want to configure the value providers
per-request or also to change the limits on the value providers (form) so
it's worth keeping these around on the context.
2016-05-13 08:11:21 -07:00
Ryan Nowak 756cd2dab8 Remove OperationBindingContext
This change trims a few concepts that aren't really needed inside
ModelBinders anymore, and removes the OperationBindingContext class.
2016-04-25 09:29:03 -07:00
Doug Bunting 6bf25cecec React to HttpAbstractions namespace changes
- aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592
- clean up `using`s
2016-03-30 16:19:42 -07:00
Ryan Nowak e1abb47b98 Fix #4238 IFormFile model binder suppresses validation
This change no longer suppresses validation for IFormFile and
IFormFileCollection model values. This will allow the use of [Required] on an
IFormFile model, or a custom attribute for validating IFormFileCollection.

These types already have ValidateChildren = false, so we don't recurse
into them.
2016-03-30 14:09:28 -07:00
Ryan Nowak fb81a5e11e Introducing ModelBinderFactory
This change separates model binding into IModelBinderProvider (decides
which binder to use) and IModelBinder (does binding). The
IModelBinderFactory is a new services with coordinates the creation of
model binders.
2016-03-29 15:45:14 -07:00
Doug Bunting d3c24637b1 Correct `Type.IsAssignableFrom()` polarity
- #3482
 - see new tests; many failed without fixes in the product code
 - add support for binding `IFormFileCollection` properties
 - make `FormFileModelBinder` / `HeaderModelBinder` collection handling consistent w/ `GenericModelBinder`++
  - see also dupe bug #4129 which describes some of the prior inconsistencies
  - add checks around creating collections and leaving non-top-level collections `null` (not empty)
 - move smarts down to `ModelBindingHelper.GetCompatibleCollection<T>()` (was `ConvertValuesToCollectionType<T>()`)
  - add `ModelBindingHelper.CanGetCompatibleCollection()`
  - add fallback for cases like `public IEnumerable<T> Property { get; set; } = new T[0];`
- #4193
 - allow `Exception`s while activating collections to propagate
- part of #4181
 - `CollectionModelBinder` no longer creates an instance to check if it can create an instance
 - not a complete fix since it still creates unnecessary intermediate lists

nits:
- correct a few existing test names since nothing is not the same as `ModelBindingResult.Failed()`
- remove a couple of unnecessary `return` statements
- correct stale "optimized" comments
- explicit `(string)`
2016-03-03 09:55:01 -08:00
Doug Bunting 8189d852d1 Remove OSx+Mono skips related to aspnet/External#50
- CoreFx worked around the underlying issue
- add `PlatformNormalizer.NormalizeContent()` call in previously-disabled test
2016-01-30 22:51:48 -08:00
N. Taylor Mullen 3be7fbdf9f Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:18:33 -08:00
N. Taylor Mullen 6a6c8ca544 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:17:07 -08:00