Commit Graph

3711 Commits

Author SHA1 Message Date
Pranav K 950db6587c Require attribute routing with [ApiController]
Fixes #6870
2017-10-04 13:13:20 -07:00
Doug Bunting e659b578f6 Typo fix 2017-10-04 09:00:34 -07:00
Kristian Hellang bfbc04f758 Use AddHttpContextAccessor method added in aspnet/HttpAbstractions#947 2017-10-03 08:52:59 -07:00
Pranav K 9038f193cd Merge branch 'foo' into dev 2017-10-03 08:48:08 -07:00
Charlie Daly c5f89a8b57 Added Conflict result helper to ControllerBase
- Added ConflictObjectResult and ConflictResult types.
- Conflict(), Conflict(object error), Conflict(ModelState modelState)
added to ControllerBase.cs.

Fixes #6172
2017-10-03 08:47:51 -07:00
Ryan Nowak e3ce1f52d4 Added Conflict result helper to ControllerBase
- Added ConflictObjectResult and ConflictResult types.
- Conflict(), Conflict(object error), Conflict(ModelState modelState)
added to ControllerBase.cs.

Fixes #6172
2017-10-02 15:05:57 -07:00
Ryan Nowak be5d4ec11e Undo a breaking change 2017-10-02 13:12:25 -07:00
Steve Sanderson afdda7cbee Update fsproj for FSharpWebSite. Fixes #6554 2017-10-02 14:35:28 +01:00
Jass Bagga 2fcfc6be7c Add EnableRangeProcessing (#6895)
Addresses #6780
2017-09-29 18:39:45 -07:00
Jass Bagga eeac99985a Only set Content-Length when serving body (#6886)
Addresses #6875
2017-09-25 15:07:12 -07:00
Kiran Challa 83c3ac62fb Updated formatters to wrap exceptions in InputFormatException for invalid input 2017-09-22 14:33:17 -07:00
Javier Calvarro Nelson f24d71136a Add breaking changes file 2017-09-22 13:53:51 -07:00
Javier Calvarro Nelson a8eda83222 Add MVC 2.0 baselines 2017-09-22 12:53:12 -07:00
Ryan Nowak 38712609bb Design extensibility for executors
We have all of these executors but they aren't really
documented/supported for extensibility today. This change introduces a
pattern for action result executors so we can make them extensible.
2017-09-22 10:32:55 -07:00
Pranav K 5d1603c37f Replace ProblemDetailsAttribute with ApiControllerAttribute 2017-09-22 10:26:13 -07:00
Kristian Hellang 97fab8711a Add UnprocessableEntityResult, UnprocessableEntityObjectResult and ControllerBase.UnprocessableEntity methods (#6851)
* Added UnprocessableEntityResult

* Added UnprocessableEntityObjectResult

* Added UnprocessableEntity overloads to ControllerBase

Fixes https://github.com/aspnet/Mvc/issues/6795
2017-09-22 09:27:29 -07:00
Pranav K 197ef139d6 Provide a way within the Page/PageModel to run code before any handler runs
Fixes #6606
2017-09-22 09:25:22 -07:00
Steve Sanderson 236ef5d1d1 Support validation and BindBehavior on top-level action parameters and bound properties. Fixes #6790 2017-09-22 10:13:48 +01:00
Meir017 0fae663b9a Update WebApplicationTestFixture.cs
removed duplicated code
2017-09-21 16:17:05 -07:00
Kiran Challa a96fb68690 Fixed FileExtensionsAttributeAdapter to trim(whitespaces, dot character) and lowercase the extensions 2017-09-21 14:52:24 -07:00
Charlie Daly 324db455d9 ControllerBase helpers refactored with lambda syntax.
- Addresses #6864
2017-09-21 13:19:33 -07:00
Pranav K 7f214492b8 Introduce a filter to send bad request results with details when ModelState is invalid (#6849)
* Introduce a filter to send bad request results with details when ModelState is invalid

Fixes #6789
2017-09-21 11:09:32 -07:00
Eilon Lipton 6780f07b3c Merge pull request #6865 from mistakenot/mistakenot/gitignore-resharper
Rider directory added to gitignore.
2017-09-21 09:39:35 -07:00
Charlie Daly cad2fb7c9f Rider directory added to gitignore. 2017-09-21 11:55:40 +01:00
Hao Kung 95c10050c9 Stop using obsolete version of AddScheme in test 2017-09-20 12:48:46 -07:00
Justin Kotalik f7968714a9 Increase minimum required version of visual studio to 15.3.0 (#6856) 2017-09-20 09:42:15 -07:00
Javier Calvarro Nelson 85f3c841f1 Revert "Revert "Improvements to the testing package.""
This reverts commit 7b28334c41.
2017-09-19 21:45:05 -07:00
Ryan Brandenburg 7b28334c41 Revert "Improvements to the testing package."
This reverts commit 96bd2769d0.
2017-09-19 18:02:53 -07:00
Pranav K f0a5af2ba7 Revisit the unwrapping code in ControllerActionInvoker
Fixes #6679
2017-09-19 09:49:37 -07:00
Javier Calvarro Nelson 96bd2769d0 Improvements to the testing package.
* Detect a ConfigureDefaultBuilder static method on Program.cs of the test site
and use it to initialize the IWebHostBuilder instance that we configure for testing.
* Make use of the new service configuration extensibility points in Hosting to override
services for testing.
* Get rid of MvcWebApplicationBuilder and move MVC specific methods into extension methods.
2017-09-18 18:12:01 -07:00
Kiran Challa 72eb546329 Added attribute adapter for DataAnnotation's FileExtensionsAttribute 2017-09-18 16:20:26 -07:00
Kiran Challa 47287c508e Added new extension methods to configure all MVC localization services
[Fixes #5436] Must call `AddViewLocalization()` to use `IStringLocalizer<T>` in an application
2017-09-18 14:28:55 -07:00
Kiran Challa 23b7d8f62a Added RequestFormLimits filter.
[Fixes #5128] Overriding Request Form max upload limit
2017-09-18 13:48:15 -07:00
Ryan Nowak e114911d77 Introduce [ApiController]
This puts a de-facto metadata approach in the box to declare
unambiguously 'Hey, I am an API!'.

I think this is worth us doing at this point because I haven't really
seen anyone in the community running with targeting conventions at
equivalence classes of controllers.

Now that we're putting API-specific, opinionated behaviors in the box,
we need to away to make it opt-in and declarative.
2017-09-18 12:43:05 -07:00
Ryan Nowak c09575dbd0 Fix #4914 patternize filter overrides
Adding some convenience methods to the context class and updating our
code to use them.
2017-09-18 12:12:44 -07:00
Pranav K 776c2604f8 Introduce opinionated API defaults.
* Introduce ProblemDescriptionAttribute to enhance some 4xx messages and produce better API description.
* Introduce IErrorDescriptionProvider to modify the shape of error response.

Fixes #6785, Fixes #6786
2017-09-14 17:07:34 -07:00
Pranav K 037c1ec47d Make @inherit + Razor Pages + _ViewImports work
Fixes #6769
2017-09-14 12:34:00 -07:00
Kiran Challa 35601f95b3 Added a model binder for handling Enum types. [Fixes #6329] Why don't we check for Enum.IsDefined on action parameters of enum type 2017-09-14 08:25:05 -07:00
Ryan Nowak db2d9ee56f Additional fixes for #4604 2017-09-13 23:39:00 -07:00
Charlie Daly 9db92dc6a7 JsonResultExecuter logs type of result.
- MvcJsonLoggerExtensions.JsonResultExecuting logs result type instead of value
- Nulls handled more elegantly.
- Two tests added to JsonResultExecutorTests.cs.
- #4604
2017-09-13 23:39:00 -07:00
Nick Chapsas db397d812b TagHelperOutput extension methods for class value manipulation (#6565)
* Added TagHelperOutput extension methods for class value manipulation
2017-09-13 11:58:10 -07:00
Kiran Challa 4f18d99d02 Added RedirectToAction overload with no arguments 2017-09-12 17:17:48 -07:00
Kiran Challa 06f6de6c11 Changed RequestSizeLimitAttribute to create an authorization filter rather than a resource filter.
[Fixes #6777] RequestSizeLimit is ignored
2017-09-12 17:03:24 -07:00
Pranav K de38922601 Allow BindPropertyAttribute to be applied on PageModel
Fixes #6653
2017-09-12 10:34:19 -07:00
Pranav K 63397653fa Make DefaultApiDescriptionProvider understand ActionResult<T>
Fixes #6784
2017-09-11 14:20:38 -07:00
Pranav K 6bf165f22f Update default Razor search paths to include ~/[PagesRoot]/Shared
Fixes #6604
2017-09-11 14:11:39 -07:00
Christiaan a8b7904b00 Fix logger category of FileStreamResultExecutor
FileStreamResultExecutor creates a logger for VirtualFileResultExecutor. I suspect this is a copy-and-paste error and creating one for FileStreamResultExecutor was intended instead.
2017-09-08 11:09:20 -07:00
Kiran Challa 3beb310866 Avoid saving TempData in case of unhandled exceptions. [Fixes #6598] BUG? Accessing TempData prevent response to have content on error. 2017-09-07 13:13:27 -07:00
Pranav K 717f1e6f7d Normalize paths in RazorViewEngine prior to invoking page factory
Fixes #6672
2017-09-07 11:36:31 -07:00
Pranav K a7cc243942 Introduce ProblemDescription 2017-09-06 18:46:35 -07:00