Commit Graph

281 Commits

Author SHA1 Message Date
Ryan Nowak 0a1d68b8f3 Remove EndpointSelectorContext 2019-05-08 08:14:24 -07:00
Ryan Nowak 1b47f44876
Add a top-level node for analyzers (#9906)
This is the first step, and just estabilishes a skeleton. The end goal
is organize our analyzers under this node because:
1. We're writing some 'top level' analyzers that depend on everything
else
2. We want to be able to service analyzers on the SDK schedule
(independent of runtime).

Next, we'll merge the MVC analyzers into this assembly since there's no
reason for them to be separate. The MVC API analyzers will remain a
separate package, but under this node. The component analyzers will
remain separate as they need to ship as a package, but will move under
this node as well.
2019-05-07 15:01:08 -07:00
Hao Kung 0dfe695468
Stop caching policies in AuthorizeFilter (#9957) 2019-05-06 11:59:37 -07:00
bordecal 2d33c32187 Allow ValidationVisitor.ValidateComplexTypesIfChildValidationFails to be configured via MvcOptions (#9312)
* Allow ValidationVisitor.ValidateComplexTypesIfChildValidationFails to be configured via MvcOptions (#8519)

* Regenerated reference source for Mvc.Core to add MvcOptions.ValidateComplexTypesIfChildValidationFails

* Simplified functional tests for MvcOptions.ValidateComplexTypesIfChildValidationFails usage scenarios
2019-05-05 07:08:25 -07:00
Ben Adams 19c9010c2f Read interface IList.Count once rather than per iteration (#9962) 2019-05-04 17:54:12 -07:00
Sébastien Ros 3f808160dd
Updating NuGet.config for benchmark apps (#9959) 2019-05-03 17:31:34 -07:00
Pranav K 093df67c06
Avoid buffering during input formatting for longer than necessary (#9806)
* Avoid buffering during input formatting for longer than necessary

EnableRewind uses FileBufferingReadStream which is not disposed until the response is completed.
This results in holding on to internal buffers for significantly longer than necessary. Changing it
to  return the buffers immediately improved the allocations and throughput.
2019-05-03 06:45:52 -07:00
Ryan Nowak 127bc7ddd3
Fixes: #4597 Parse URI path with an endpoint (#9728)
Adds functionality to parse a URI path given a way to
find an endpoint. This is the replacement for various machinications
using the global route collection and `RouteData.Routers` in earlier
versions.

For now I'm just adding a way to do this using Endpoint Name since it's
a pretty low level feature. Endpoint Name is also very direct, so it
feels good for something like this.
2019-05-02 21:11:59 -07:00
Nate McMaster ae8e96f154
Remove API check baselines and related project settings (#9846) 2019-04-30 14:58:13 -07:00
Pranav K 2570126b27
Fixup XUnit warnings when running MVC tests (#9823) 2019-04-29 09:32:48 -07:00
David Fowler 0d77594d17
Make endpoint routing allocation free in common scenarios (#9774)
- This change tries to remove the EndpointSelectoContext allocation by making it a wrapper struct over the HttpContext. Unlike before, the HttpContext gets mutated once any component in the routnig pipeline sets a non null endpoint. This used to happen after the processing was complete.
- This change also implements the IRouteValuesFeature and IEndpointFeature in HttpProtocol to avoid the feature allocation and feature collection version churn.
- We also set the IRouteValuesFeature in IRouter based scenarios.
- Since we're not implementing IRoutingFeature in endpoint routing anymore
we can just create the RouteData inside MVC. We do this by polyfilling RouteData when using endpoint routing inside of MVC
- Implement GetRouteValue in terms of IRouteValuesFeature
- Noop if the EndpointRoutingMiddleware if an endpoint is already set
- Added tests
2019-04-28 21:29:08 -07:00
Ajay Bhargav Baaskaran 8e37f8477d
Removed unused FSharpWebsite (#9794) 2019-04-28 09:18:19 -07:00
James Newton-King 8ce7bd171d
Make RouteOptions.EndpointDataSources internal (#9708) 2019-04-26 07:54:27 +12:00
Ryan Nowak ab3e0f953e
Makes RouteName => endpoint name for MVC (#9721)
* Makes RouteName => endpoint name for MVC

* feedback
2019-04-24 15:13:30 -07:00
dotnet-maestro[bot] 8eb2e8baec
[master] Update dependencies from dotnet/arcade (#9715)
* Update dependencies from https://github.com/dotnet/arcade build 20190423.2

- Microsoft.DotNet.GenAPI - 1.0.0-beta.19223.2

* Adjust to GenApi change in `enum` ordering
- was sorted by name, now by value
2019-04-24 19:21:37 +00:00
Ryan Nowak 6a99743d33 Fixes: #7611 - return convention builders for MVC
Adds support for returning convention builders from the various MVC
endpoint routing methods.

The fallback methods are excluded because the fallback endpoint doesn't
actually get executed.
2019-04-24 11:03:38 -07:00
Pranav K 9ac2f52b22
Specify Content-Length for buffered responses (#9699) 2019-04-24 09:57:53 -07:00
Martin Gubis 1d5d144c12 Introduce IPageApplicationModelPartsProvider (#9066)
* Resolved  #6919. It might be required to rework unit tests.
2019-04-23 14:37:03 -07:00
Doug Bunting ce8f053af7
Rename all the service reference things (#9559)
- #7492
  - remove document generation from client project; will be included in Web API project infrastructure (coming soon)
  - adjust eng/ProjectReferences.props to new project name
  - simplify item de-duplication in `_CreateCompileItemsForServiceFileReferences` target i.e. use `Remove` attribute
    - also handle `.tsx` files in this target
- provide `%(FirstForGenerator)` metadata, #4916
- add `$(OpenApiGenerateAtDesignTime)` property (default `true` for now), #4944
- generate code in `obj` directory by default, #4945
- provide a default `%(CodeGenerator)` value, ##7491 1 of 2 (remainder will come in next milestone)

nits:
- remove a useless `StringBuilder.Append(...)` call
- remove `%(OpenApiProjectReference.SourceProject)` metadata, duplicated `%(OriginalItemSpec)`
- be more consistent about using element syntax for item metadata
2019-04-22 11:15:54 -07:00
Doug Bunting 1c19e8ee89
Merge branch 'release/2.2' -> 'master' (#9591) 2019-04-22 11:12:35 -07:00
Pranav K 418f3d82dd
React to new System.Text.Json features (#9572) 2019-04-21 20:48:41 -07:00
Ryan Nowak f0ea4fc8a1 Update solutions
We have a new SignalR package and it needs to be the added.
2019-04-21 15:16:54 -07:00
Pranav K e42f979cca
Add a System.Text.Json based IJsonHelper (#9566)
* Add a System.Text.Json based IJsonHelper

Fixes https://github.com/aspnet/AspNetCore/issues/9564
2019-04-21 12:10:47 -07:00
Pranav K 0303c9e90b
AddControllersWithViewsCore should add CacheTagHelper services (#9580) 2019-04-21 09:51:41 -07:00
Pranav K 5e953124e6
Add support for System.Text.Json based JsonResult executor (#9558)
Fixes https://github.com/aspnet/AspNetCore/issues/9554
2019-04-21 09:13:30 -07:00
Doug Bunting dfae19ee7c
Merge branch 'release/2.2' -> 'master' 2019-04-19 18:53:15 -07:00
John Luo 7a040f310b
Enable Pubternal API checks (#9530)
* Enable Pubternal API checks

* Use pragma

* Convert to pragma

* Test fix

* Remove extra restore dependencies
2019-04-19 18:49:07 -07:00
Nate McMaster 9212f4a3df
Update corefx dependencies and react to changes in JSON API (#9563) 2019-04-19 11:42:41 -07:00
Ben Adams d46388b58e Lazy create MVC ControllerActionInvoker statemachines (#9533)
* Lazy create ControllerActionInvoker.InvokeInnerFilterAsync statemachine

* Lazy create ControllerActionInvoker.InvokeNextActionFilterAwaitedAsync statemachine

* Lazy create ControllerActionInvoker.InvokeNextActionFilterAsync statemachine

* Lazy create ControllerActionInvoker.InvokeActionMethodAsync statemachine

* Lazy create Controller.OnActionExecutionAsync statemachine

* Ref assembly

* Formatting feedback
2019-04-19 07:48:26 -07:00
Pranav K acf45106fc
Use FileBufferingWriteStream in ViewComponentResultExecutor (#9523)
Fixes https://github.com/aspnet/AspNetCore/issues/9443
2019-04-18 19:27:55 -07:00
James Newton-King 7669cf0d03
Move Microsoft.AspNetCore.Authorization.Policy types (#9492) 2019-04-19 13:24:36 +12:00
Ryan Nowak 6074daacae Fixes: #9468 2019-04-18 12:47:42 -07:00
Ben Adams 8fcadf72cd Allow headers to match on ReferenceEquals before OrdinalIgnoreCase (#9341) 2019-04-18 12:00:01 -07:00
Justin Kotalik 7448964388 Mark mvc test as flaky (#9489) 2019-04-17 21:46:27 -07:00
David Fowler 32c46c7201
Create an activity more often than before (#9361)
- Create an Activity if there's a diagnostic listener attached with the activity name or if logging is enabled.
- Add the activity id to the logging scope (and call the field ActivityId)
2019-04-17 18:23:12 -07:00
Pranav K 92cae6faab
Buffer writes from sources of synchronous writes (#9015)
* Buffer writes from sources of synchronous writes

Fixes https://github.com/aspnet/AspNetCore/issues/6397
2019-04-17 18:11:07 -07:00
Pranav K 004ac25983
Remove AddRazorSupportForMvc from MVC and Blazor projects (#9446)
Fixes https://github.com/aspnet/AspNetCore/issues/9126
Fixes https://github.com/aspnet/AspNetCore/issues/9183
Fixes https://github.com/aspnet/AspNetCore/issues/9207
2019-04-16 20:46:51 -07:00
Ryan Nowak 7021df89e4 Remove dynamic from page endpoints 2019-04-16 19:36:32 -07:00
Ryan Nowak 6f305373ca Allow fallback to controller to use MatcherPolicy 2019-04-16 19:36:32 -07:00
Ryan Nowak 6eeda774ef Implement IEndpointSelectorPolicy for ConsumesMatcherPolicy 2019-04-16 19:36:32 -07:00
David Fowler 48f0a76ea9
Support plain text exception formatting (#9342)
- If there's no Accept: text/html then print the exception.ToString as plaintext
2019-04-16 18:34:07 -07:00
Pranav K e2477706b6
Always set flag in CorsMiddleware once it executes (#9440)
Fixes https://github.com/aspnet/AspNetCore/issues/9348
2019-04-16 16:28:27 -07:00
Pranav K 51028dd129
Remove use of IgnoreNullPropertyValueOnRead and ReaderOptions from JsonSerializerOptions (#9429)
Fixes https://github.com/aspnet/AspNetCore/issues/9406
2019-04-16 16:24:17 -07:00
Pranav K 2be80522b2
Prevent synchronous writes when using Razor (#9395)
* Do not perform synchronous writes to the Response TextWriter after a Razor FlushAsync
* Use ViewBuffer to perform async writes to the response when using ViewComponentResult

Related to #6397 

Fixes https://github.com/aspnet/AspNetCore/issues/4885
2019-04-16 16:12:37 -07:00
Nate McMaster d004cf0f14
Merge branch 'release/2.1' into release/2.2 2019-04-15 16:42:07 -07:00
Pranav K 836964a653 Don't log action and page handler arguments above Trace level (#9227) 2019-04-15 13:29:07 -07:00
Ben Adams 1baeaaac36 Feedback 2019-04-14 17:55:16 -07:00
Ben Adams 70b02f8406 Lazy create ResourceInvoker.InvokeNextResourceFilterAwaitedAsync statemachine 2019-04-14 17:55:16 -07:00
Ben Adams cfc22fe0df Lazy create ResourceInvoker.InvokeNextResultFilterAwaitedAsync statemachine 2019-04-14 17:55:16 -07:00
Ben Adams 8c97cbe6aa Lazy create ResourceInvoker.InvokeNextResultFilterAsync statemachine 2019-04-14 17:55:16 -07:00