Commit Graph

477 Commits

Author SHA1 Message Date
Doug Bunting c74a945dda
Convert `RouteValueDictionary` values to `string` using `CultureInfo.InvariantCulture` (#8674)
* Convert `RouteValueDictionary` values to `string` using `CultureInfo.InvariantCulture`
- #8578
- user may override this choice in one case:
  - register a custom `IValueProviderFactory` to pass another `CultureInfo` into the `RouteValueProvider`
- values are used as programmatic tokens outside `RouteValueProvider`

nits:
- take VS suggestions in changed classes
- take VS suggestions in files I had open :)
2018-10-30 20:09:17 -07:00
Pranav K 734b919b02 Respect SuppressInferBindingSourcesForParameters
Fixes https://github.com/aspnet/Mvc/issues/8657
2018-10-30 14:37:21 -07:00
Pranav K 35d2ab37f7 Allow passing a dictionary to ValidationProblemDetails
Fixes https://github.com/aspnet/Mvc/issues/8645
2018-10-29 09:56:17 -07:00
James Newton-King 6bb292cfcc
Add test for metadata precedence (#8642) 2018-10-27 07:59:15 +13:00
Pranav K 2544926b2f Provide a convenience API to configure ApiBehaviorOptions 2018-10-24 10:10:33 -07:00
James Newton-King 40959a97e7
Fix link generation of routes with default values (#8616) 2018-10-23 16:10:43 +13:00
Ryan Nowak 76a30b0911 Remove LinkGenerationTemplate
This doesn't really accomplish our goals for 2.2 - I don't have a clear
scenario where I would tell a developer to use this VS something else.
Will reevaluate in 3.0
2018-10-21 15:39:59 -07:00
Pranav K 27e75e7a51
Add a switch to allow turning on ValidationVisitor shortcircuiting (#8599) 2018-10-17 15:47:01 -07:00
Pranav K fb57810f29 Shortcircuit validation when using default validator providers and no validation metadata is discovered
Fixes https://github.com/aspnet/Mvc/issues/5887
2018-10-12 14:47:06 -07:00
Ryan Nowak 6cee2431f1 React to routing changes 2018-10-08 15:45:32 -07:00
David J. Quiroga 956441aa68 Ignore created URI if Assembly.CodeBase contains a fragment (#8556)
* Fixes #8367
2018-10-08 10:41:04 -07:00
Ryan Nowak 384b814349 React to IEndpointSelectorPolicy changes 2018-10-05 21:03:53 -07:00
Doug Bunting 5bddd226a3
Use Internal.AspNetCore.Sdk as an MSBuild SDK
- should resolve issues with occasional strange MSBuild caching issues in this repo
- modeled after aspnet/Scaffolding#905
- follows aspnet/BuildTools#729 recommendation to check in global.config file
  - see also Microsoft/msbuild#2914
- use newer KoreBuild
  - `.\build.cmd -update /t:noop`
2018-10-04 15:12:38 -07:00
James Newton-King 94101a9cde
Add PageRouteTransformerConvention (#8541) 2018-10-04 17:34:26 +13:00
James Newton-King 7854d65c11
Support page parameter in attribute route (#8530) 2018-10-04 14:39:40 +13:00
Pranav K a48e75dfb4
Implicitly set content type for ObjectResults containing ProblemDetails (#8512)
* Implicitly set content type for ObjectResults containing ProblemDetails

Fixes #8467
2018-10-02 10:24:38 -07:00
Ryan Nowak 3667b0481a React to routing API changes
Reaction for: https://github.com/aspnet/Routing/pull/822
2018-09-30 14:26:06 -07:00
Ryan Nowak cb1393cbb1 Adding functional tests for LinkGenerator 2018-09-29 20:34:48 -07:00
Pranav K ccb6579cd7
Do not return ProblemDetails for < 4xx status codes
Fixes #8504
2018-09-28 10:33:45 -07:00
Ryan Nowak 831937c86c Add LinkGenerator extensions for MVC 2018-09-26 09:37:46 -07:00
Doug Bunting 5c8dfef15e
Change `CollectionModelBinder` and `ComplexTypeModelBinder` to enforce `[BindRequired]`
- #8180
- add an error when binding fails for top-level model
  - same case as when MVC creates "default" / empty model i.e. `ParameterBinder` can't detect this
- update `CollectionModelBinder` subclasses and the various providers as well
- controlled by existing `MvcOptions.AllowValidatingTopLevelNodes` option

smaller issue:
- change `ModelBinding_MissingBindRequiredMember` resource to mention parameters too
2018-09-21 11:08:16 -07:00
Ryan Nowak 5c4c746797 Reaction PR from routing rename 2018-09-20 10:15:50 -07:00
Doug Bunting 47d6d4e82c
Update `FormFileModelBinder` to re-add prefix `ParameterBinder` removed incorrectly
- #7562 part 2
- add `OriginalModelName` to `ModelBindingContext`

nit: take VS suggestions, mostly to inline collection initialization in `FormFileModelBinderTest`
2018-09-18 11:44:48 -07:00
Doug Bunting c13e2498a8
Create model in `ComplexTypeModelBinder` if ANY property has a greedy binding source
- #7562 part 1
2018-09-18 11:44:37 -07:00
Pranav K 233140c33a
Allow IFormFile parameters annotated with [FromForm] to be correctly … (#8452)
* Allow IFormFile parameters annotated with [FromForm] to be correctly bound in ApiControllers

Fixes #8311
2018-09-14 09:06:32 -07:00
Pranav K cb88e906b2 Allow ProducesAttribute to apply along with conventions
Fixes #8389
2018-09-12 13:58:02 -07:00
Pranav K 13281613a5
Refactor DefaultPageApplicationModel to use conventions 2018-09-12 12:28:16 -07:00
Simon Cropp 43d4416a1d Fix typos (#8413) 2018-09-12 09:34:45 -07:00
James Newton-King dfae9c208a
Add IParameterTransformer support (#8329) 2018-09-12 21:46:41 +12:00
James Newton-King 105f8b47a1
Fix endpoint support for area/controller/action in attribute route (#8447) 2018-09-12 21:16:50 +12:00
James Newton-King 6e27a04bf3
No HttpContext to route constraints in MvcEndpointDataSource (#8436) 2018-09-11 10:12:09 +12:00
Ryan Nowak f573b8840a Fix aspnet/Routing#782
Currently MVC is still running the IActionConstraint implementations for
features that we've already moved into the routing layer. This has a
significant perf cost associated with, and so we want to skip it because
it's redundant. However if anyone has implemented their own
`IActionConstraint`-based features, they still need to just work.

This change takes the approach of skipping the action constraint phase
at runtime unless we see something 'unknown'. This is an all or nothing
choice, and will run action constraints if **any** action constraint we
don't special case exists. This is the most compatible behavior (running
redundant constraints) when the application is using constraints that
the developer implemented.

Another approach I considered was to eliminate these constraints as part
of the process of building ADs. I don't think that's ideal because
people have written code that introspects action constraints. We should
consider something like this in 3.0.
2018-09-09 15:17:05 -07:00
James Newton-King 863b1c2c97
Action endpoint metadata contains attributes from action and controller (#8395) 2018-09-07 10:01:40 +12:00
Simon Cropp b156dee4f1 Fix some spelling (#8378) 2018-09-06 07:39:01 -07:00
Ryan Nowak fabe189470 React to LinkGenerator changes 2018-09-05 20:52:37 -07:00
Pranav K f90a47c5af
Introduce ProducesErrorResponseTypeAttribute
Fixes https://github.com/aspnet/Mvc/issues/8288
2018-08-30 11:24:03 -07:00
James Newton-King 927e7c8bfc
Support route data tokens with Endpoint Routing (#8360) 2018-08-30 15:14:34 +12:00
Pranav K 82a01a414d
Set trace id in ProblemDetalsClientErrorFactory 2018-08-29 16:03:08 -07:00
James Newton-King b649133eec
Refactor KnownRouteValueConstraint to not require HttpContext (#8352) 2018-08-30 08:57:53 +12:00
James Newton-King 28f96bf832
Fix obsolete build warning (#8358) 2018-08-30 08:16:57 +12:00
Pranav K 667ad4daff Use ClientErrorData to configure ClientErrorResultFilter
Fixes #8289
2018-08-28 13:35:32 -07:00
Ryan Nowak 0fcf2448c3 Fix aspnet/Routing#722
Exposes a separate change token that will be triggered after action
descriptors have been updated.
2018-08-27 17:24:21 -07:00
James Newton-King 8ed9d0aac2
Use Endpoint instead of RouteEndpoint where possible (#8331) 2018-08-28 11:00:11 +12:00
Ryan Nowak a634f6b116 add another test 2018-08-27 15:34:37 -07:00
Ryan Nowak cb0627b28a Addressing a skipped test
I think something that was meant to be revisited in a PR got left
behing. I found this while fixing aspnet/Routing#772 and it seems worth
addressing.

This change removes the hardcoding of action/controller/area in the
data source, and corrects the behavior of required route values when
they aren't in that set.
2018-08-27 15:34:37 -07:00
Pranav K a7301120b1
Unwrap filter factories in TypeFilterAttribute & ServiceFilterAttribute
Fixes #7855
2018-08-24 14:15:40 -07:00
Pranav K 8eea0ad44c Update tests to latest compat switch 2018-08-23 08:09:02 -07:00
James Newton-King e2de54a92d
Update MvcEndpointDataSource to use RoutePattern (#8249) 2018-08-23 21:42:42 +12:00
James Newton-King cbe1526763
React to routing changes (#8303) 2018-08-22 17:15:09 +12:00
Pranav K 5bd818bd64
Introduce ProblemDetailsFilter
Fixes https://github.com/aspnet/Mvc/issues/6786
2018-08-21 17:29:12 -07:00