Commit Graph

67 Commits

Author SHA1 Message Date
Ryan Brandenburg 03cdd15e5c SaveTempDataFilter handle write to body 2017-01-27 10:54:00 -08:00
Kiran Challa 82b2e9c75c Added functional tests for Antiforgery related to setting no-cache headers 2016-11-02 16:29:34 -07:00
Kiran Challa 89bd6dc1cd [Fixes #5212] Added a cookie based ITempDataProvider 2016-10-03 14:04:57 -07:00
jacalvar 7a3f24d49d [Fixes #4960] Action results returned from controller actions rendered as json instead of executed 2016-07-27 14:42:46 -07:00
Doug Bunting 62803d5979 Serialize JSON using camel case by default
- #4283
- update `JsonSerializerSettingsProvider` to choose the `CamelCaseNamingStrategy`
2016-06-09 11:58:23 -07:00
Derek Gray 5a3875ea72 Alter content negotiation algorithm so that it can be configured (via
MvcOptions) to always respect an explicit Accept header. Fixes #4612.
2016-06-07 16:12:36 -05:00
jacalvar 6a6d2e0d9f [Fixes #4506] Move and rename ActionDescriptor.Name to ControllerActionDescriptor.ActionName 2016-05-31 23:13:20 -07:00
Doug Bunting e3db547011 Add `[Remote(routeName : "name")]` tests
- relates to #4445
- also relates to #4309 / fb07fee though restored and renamed files are slightly different
 - latest Unobtrusive version; copy just one file under `wwwroot`
- add JavaScript file and CDN links to enable manual testing of `[Remote]` tests in `BasicWebSite`
 - include renamed files for recreating the minimized JavaScript file manually
2016-05-03 12:25:00 -07:00
Doug Bunting d8d2e54506 Remove extra options to manipulate `JsonSerializerSettings`
- #4339: remove non-recommended JSON formatter constructors
 - affects `JsonInputFormatter`, `JsonOutputFormatter`, `JsonPatchInputFormatter`
 - `JsonOutputFormatter` cleanup also impacts `JsonHelper`
 - rename and make `SerializerSettingsProvider` class public; use it as appropriate
- #4409: make `SerializerSetings` properties get-only and `protected`
 - affects `JsonInputFormatter`, `JsonOutputFormatter`

Recommended patterns:
- change `JsonSerializerSettings` values in `MvcJsonOptions` for almost all customizations
- find `JsonOutputFormatter` in `MvcOptions.OutputFormatters` when limiting per-result formatters
- start with `JsonSerializerSettingsProvider.CreateSerializerSettings()` when customizing a per-result formatter
2016-04-27 14:48:16 -07:00
jacalvar de9ffb13c7 [Fixes #3732] Simplify controller discovery.
* Introduce ControllerAttribute and use it to mark base classes as controllers.
* Changed rules for controller discovery to:
  * All controller types must be public, concrete, non open generic types.
  * NotController attribute is not applied to any type oif the hierarchy.
  * The type name ends with controller.
  * Controller attribute is applied to the type or to one of its ancestors.
2016-03-31 10:50:26 -07:00
Ryan Nowak fec1268bf3 Remove ModelBinding features from ResourceFilters
Removes all of the ModelBinding configuration support from Resource
Filters. We haven't come up with concrete scenarios around these features,
and don't want to paint ourselves into a corner with extensibility.
2016-03-16 16:33:14 -07:00
ryanbrandenburg 1ae1cdb10b * Remove ServiceProvider 2016-03-15 09:57:17 -07:00
ryanbrandenburg f1fa1bd8f4 * Remove JsonViewComponentResult 2016-03-11 11:40:54 -08:00
Kiran Challa fd3ee49987 [Fixes #4085] Controller helper inconsistency: HttpNotFound(), Ok() 2016-02-19 09:25:04 -08:00
N. Taylor Mullen 096007b394 Updated `Controller`s `ViewComponent` method to handle arguments.
- This bit was missed when changing the `ViewComponent` invocation pattern resulting in the inability to invoke `ViewComponent`s with arguments in a `Controller`.

#4004
2016-02-02 15:42:23 -08:00
jacalvar 7cbb263edb [Fixes #3874] Null passed as arguments to controller method parameters when no InputFormatter matches
* Add an UnsupportedContentType to the ModelState dictionary when no formatter can read the body.
* Add a filter to the pipeline that searches for that specific exception and transforms the response into 415.
2016-01-28 15:46:17 -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
javiercn 2063356f24 [Fixes #3683] Replace implementations in MediaTypeComparisons and
MediaTypeEncodings with memory efficient implementations using a MediaType
struct.
2016-01-12 15:09:48 -08:00
jacalvar 830fd410f5 Remove runtime dependency usage of MediaTypeHeaderValue.
Removes usage of MediaTypeHeaderValue in ApiExplorer, InputFormatters and
OutputFormatters

Public interface changes with stub implementation.
2016-01-12 15:09:46 -08:00
Hao Kung 9364f896b3 Options renames for functionals 2015-12-21 16:18:22 -08:00
Doug Bunting 59824dc7be MVC functional test cleanup (part 1)
- #3612 subpart 2 of 2
- merge `ActionConstraintsWebSite`, `AntiforgeryTokenWebSite` and `ContentNegotiationWebSite` into `BasicWebSite`
  - remove tests depending on `ErrorReporterMiddleware` in merged sites; not used in `BasicWebSite`
- delete `CompositeViewEngineWebSite`, `Microsoft.AspNet.Mvc.ViewEngines.CompositeViewEngineTest` covers cases
- delete `CorsMiddlewareWebsite`, soon to be in Cors repo (see aspnet/CORS#57)
- remove `SendFileMiddleware` from FilesWebSite, unused there
2015-12-14 21:50:55 -08:00
Kiran Challa 57b88baad0 [Fixes #3624] MVC functional test cleanup (part 2) 2015-12-10 16:26:39 -08:00
Kiran Challa dd774366f6 Addressed feedback 2015-12-03 14:42:14 -08:00
Kiran Challa 9288ab1a34 Removed TempDataWebsite and merged to BasicWebsite and fixed tests 2015-12-03 14:42:11 -08:00
Kiran Challa 3c694ce77c Movig RequestServicesWebsite to BasicWebsite 2015-12-03 14:42:10 -08:00
ryanbrandenburg 91e837d465 * Debug log exceptions in JsonInput deserializing 2015-11-30 11:19:22 -08:00
Ryan Nowak 8682fe0cfd Replace ActionBindingContext with ControllerContext
This change introduces ControllerContext for inside of Controllers, and
controller-specific extensibility points. ControllerContext carries with
it the model binding infrastructure needed to do all of the things that
controllers need to do.
2015-11-20 15:32:37 -08:00
Kiran Challa 982c7abea8 [Fixes #3503] Removing formatters on a given type only works on collections in MVC options 2015-11-18 09:56:44 -08: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 046cb976b3 Move ActionResult classes back to main namespace 2015-09-16 21:42:31 -07:00
Ryan Nowak 229724c4ea Reorganize MVC namespaces 2015-09-01 22:28:33 -07:00
Doug Bunting 6106375306 Add `HttpOkResult`, `HttpOkObjectResult`, and `Ok()` methods in `Controller`
- #2825
- new class names align with existing types such as `HttpNotFoundResult` and `HttpNotFoundObjectResult`
- remove similar types from WebApiCompatShim and use replacements in `ApiController`
 - `NegotiatedContentResult<T>` remains because Core doesn't have an exact replacement

nits:
- add missing periods in some `Controller` doc comments
2015-07-23 18:49:36 -07:00
Ryan Nowak ccb2f2deda React to move of StatusCodes 2015-07-08 12:43:33 -07:00
Ajay Bhargav Baaskaran e2787b3b84 [Fixes #2715] Removed formatter dependency from JsonResult and JsonViewComponentResult 2015-06-25 14:09:32 -07:00
Ajay Bhargav Baaskaran 48e0b3261c [Fixes #2547] Fixed attribute value prefix with dynamic content being ignored 2015-05-18 17:15:38 -07:00
Ryan Nowak cc4ee1068d Fix #2414 Part 2 - Add [DefaultValue(...)] support to the invoker for
action parameters
2015-05-14 13:58:02 -07:00
Kiran Challa 4bed2e6f2b [Fixes #2545] RedirectToRouteResult doesn't use RouteName property when calculating destination URL 2015-05-13 12:35:25 -07:00
James Newton-King ab4cd5c4c4 Add JsonHelper for serializing JSON in views
- remove NotNull from JsonHelper Serialize
2015-05-11 16:01:08 -07:00
Ajay Bhargav Baaskaran d6012d4297 [Fixes #2506] Added overload to Controller.Json to accept JsonSerializerSettings 2015-05-11 12:36:45 -07:00
N. Taylor Mullen 64e726d2b2 Update LICENSE.txt and license header on files. 2015-05-01 13:55:25 -07:00
Yishai Galatzer ed8e5716ea Remove INestedProviderXXX
React to aspnet/DependencyInjection#179
2015-02-23 15:18:39 -08:00
Pranav K 5e69d90076 * Modify DefaultControllerTypeProvider to look at the object graph to
determine if any ancestor has the "Controller" suffix.

* Introduce NonControllerAttribute to opt out of Controller detection.

Fixes #1274
2015-02-15 22:11:37 -08:00
Ajay Bhargav Baaskaran ac6a1a6a80 Replaced status code number with constants 2015-02-05 16:43:59 -08:00
sornaks 6e8cc6ba74 Adding extension methods ConfigureMvcOptions and ConfigureRazorViewEngineOptions. 2015-02-04 14:07:07 -08:00
Chris Ross 91d7e382d1 Consume new strongly typed headers. Remove temp implementations. 2015-01-14 15:51:34 -08:00
Doug Bunting 7eb106676c Add missing license headers
- #EngineeringDay
- license present but incorrect in just a few files
- skip generated files such as Resources.Designer.cs and files under
  test\Microsoft.AspNet.Mvc.Razor.Host.Test\TestFiles\Output
2014-11-20 22:54:05 -08:00
Doug Bunting 315908af5f Apply VS' FormatDocument and RemoveAndSort to all *.cs files
- #EngineeringDay
- VS does not yet format auto-properties nicely; reverted what it did

Also revert changes under
- test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles
2014-11-20 21:15:46 -08:00
Ryan Nowak eb6598e1b9 Fix flaky NoContentFormatter test 2014-11-20 17:48:00 -08:00
Doug Bunting 5e067cdb9e Delete trailing whitespace
- #EngineeringDay
- Total replaced: 660  Matching files: 270 in *.cs
- Total replaced: 250  Matching files: 32 in all other files
- Total replaced: 22  Matching files: 8 in a few stragglers

Did not change files under following directories
- test\Microsoft.AspNet.Mvc.Razor.Host.Test\TestFiles\Output
- test\Microsoft.AspNet.Mvc.FunctionalTests\compiler\resources
- test\WebSites\TagHelpersWebSite
(Razor generates trailing whitespace in a case or two)
2014-11-20 16:18:09 -08:00
Ryan Nowak 7c961e3ce8 TODO removal
For each of these TODOs:

- If there's an active bug tracking the work, and the TODO provides
  something of value, I left it and standardized the formatting. I also
  added comments to the bug.

- If the comment provided no value (implement feature X when we do feature
  X), I deleted it with impunity.

- If the comment was stale (won't fix or just out of date), then we
  removed it uncerimoniously.

There was a single TODO that was actually actionable, so I enabled that
test.
2014-11-20 15:01:35 -08:00