Commit Graph

212 Commits

Author SHA1 Message Date
YishaiGalatzer 80ef37ab0a Add unit tests to controller properties 2014-10-09 18:18:03 -07:00
YishaiGalatzer 4baa2910b7 Add compatibility items for controller back from MVC 5 2014-10-09 16:42:39 -07:00
Hao Kung b6bd7f5d78 React to UsePerRequestServices 2014-10-09 14:17:04 -07:00
Hao Kung 6dfcfaa7eb React to options changes 2014-10-08 12:56:53 -07:00
Murat Girgin d3ef91ea91 Fixing NRE with logging 2014-10-08 09:47:39 -07:00
YishaiGalatzer fea30a4096 Making action selection logging not throw on 404 2014-10-07 23:32:59 -07:00
Ryan Nowak 19fbcdf5a8 Fix for #1271 - Add copy constructors for ApplicationModel types. 2014-10-07 19:40:42 -07:00
sornaks 5b2948dd73 Excluding a test case in Mono + Fixing a test case. Fixing line lengths. Fixing error messages for tests to pass in Mono. 2014-10-07 11:11:55 -07:00
sornaks a88f59fc49 Issue #1176: Renaming ActionDescriptor, ActionDescriptorProvider, ActionInvoker, ActionInvokerProvider, ActionExecutor, ModelBuilder, Tests. Either dropping "Reflected" or changing it to "Controller" depending on the context. 2014-10-06 20:21:55 -07:00
YishaiGalatzer 144a4b5921 Make RouteDataActionConstraint be POCO only 2014-10-06 16:54:41 -07:00
sornaks f1c1549267 Issue #452: Changes to enable validation for objects generated by InputFormatters. UnitTests + FunctionalTests for the same. 2014-10-06 16:29:56 -07:00
David Fowler 5890b5b254 Fixed up references 2014-10-05 13:24:00 -07:00
Ryan Nowak 78a4e78358 Fix for #975 - Implementing IActionConstraint and ActionMethodSelectorAttribute
IActionConstraint follows a provider model similar to filters. The
attributes that go on actions/controllers can be simple metadata markers,
the 'real' constraint is provided by a set of configurable providers. In
general the simplest thing to do is to be both an
IActionConstraintMetadata and IActionConstraint, and then the default
provider will take care of you.

IActionConstraint now has stages based on the Order property. Each group
of constraints with the same Order will run together on the set of
actions. This process is repeated for each value of Order until we run out
of actions or run out of constraints.

The IActionConstraint interface is beefier than the equivalent in legacy
MVC. This is to support cooperative coding between sets of constraints
that know about each other. See the changes in the sample, which implement
webapi-style overloading.
2014-10-03 18:50:01 -07:00
sornaks 0d8a7368d9 Issue #1141 - When Accept header or Accept-Charset header has invalid QualityFactor we throw.
Fix: Imitating the same behavior as it is in WebApi. We ignore the entire header even if one part of it is invalid.
2014-10-03 16:25:51 -07:00
harshgMSFT 572ec0175c Fix for 1071: Output Formatters should be invoked for writing out the response. 2014-10-03 10:54:59 -07:00
jacalvar a2023d35ee [Fixes #429] FileResult
1) Implemented FilePathResult to efficiently return files from disk.
2) Implemented FileStreamResult to return content from a stream.
3) Implemented FileContentResult to return content from a byte array.
2014-10-02 12:50:24 -07:00
YishaiGalatzer 9de86892a7 Cleanup namespaces and Task.FromResult 2014-10-02 11:49:44 -07:00
Ryan Nowak 414c009b80 Removing Overloading and Automatic verb-mapping
This change removes WebAPI-style method parameter overloading and the
automatic mapping of 'unnamed' actions based on method names. For all
practicaly purposes, this change restores the MVC5 behavior for action
selection.

WebAPI-style overloading will be brought back in the future via a set of
opt-in constructs.
2014-10-01 18:46:48 -07:00
Pranav K ad8ab4b8fd Adding support for ViewLocationExpanders to allow modifying view locations
without changing the view engine.

Fixes #1039
2014-10-01 16:15:25 -07:00
Ryan Nowak d8995a7767 Fix for #1192 - Support customizing reflected model through attributes
This adds support for attributes which interact with reflected model.
These conventions are applied after all of our built-in constructs so that
you can see and modify the results.
2014-10-01 14:15:34 -07:00
Pranav K 6c49d0b40e Updating SyncAction_WithException to not test for exception message
Skipping PropertyHelper_WorksForStruct on Mono until further
investigation.
2014-10-01 11:53:21 -07:00
Pranav K 7b5a97d04e Updating TokenProviderTests to use GetAuthenticatedIdentity instead of creating GenericIdentity 2014-10-01 11:35:43 -07:00
Pranav K 4b56fe157d Fixing build break 2014-10-01 11:01:11 -07:00
Pranav K ecb16db58e Remove and sort usings and fixing formatting 2014-10-01 10:28:54 -07:00
Pranav K 38e82c0aa5 Updating Microsoft.AspNet.Mvc.Core.Test to work on Mono 2014-10-01 10:05:36 -07:00
Kiran Challa 1c8582d77a [Fixes #1183] Response uses chunked encoding when returning a string 2014-10-01 07:23:11 -07:00
YishaiGalatzer f82516d155 Fix issue https://github.com/aspnet/Mvc/issues/1202 2014-09-30 12:47:03 -07:00
David Fowler 6279229a7c Removed primary ctor usage 2014-09-28 09:20:06 -07:00
Kiran Challa fdeff1188b [Fixes #926] Protocol & Host name ignored when creating action link 2014-09-26 17:20:56 -07:00
Ryan Nowak 3cd6d3e060 Adding Api Explorer 2014-09-25 15:31:51 -07:00
YishaiGalatzer 6600e68fc0 Create a pre compilation module and apis to allow meta programming
to precompile razor pages.

This is limited to sites where the .cshtml are still deployed. It's
current purpose is to speed up startup. Deploying without the razor
files is a separate feature.
2014-09-25 11:26:11 -07:00
Kiran Challa 43c7ddb9b7 Making UrlHelper's methods virtual 2014-09-24 13:01:34 -07:00
jacalvar f2dab5eaa7 [Fixes #1156] EmptyResult should not set status code (or do anything for that matter) 2014-09-22 14:12:00 -07:00
sornaks 96318dcbc2 Issue #1072: Adding Unit Tests for GetSupportedContentTypes, CanWriteResult and for XmlFormatters with DeclaredType as object. 2014-09-22 11:17:37 -07:00
Ryan Nowak 529b17ea70 Fix for codeplex-1120 - Move CreateSerializer out of the base class
This is a small refactor as a precursor for api-explorer work.
2014-09-17 18:07:42 -07:00
Pranav K 646c0d704d Limit the maximum number of Model errors to a reasonable value.
Fixes #490
2014-09-16 09:57:00 -07:00
harshgMSFT 0c13563e33 AF Cookie should be reused within the context of same request.
Fixes issue #959
2014-09-15 16:23:45 -07:00
Ryan Nowak 7ed2de297e moving global filters to options 2014-09-15 15:34:45 -07:00
jacalvar 25838cee55 [Fixes #911] RequireHttpsAttribute does not exist in MVC 6
1. GET requests will be redirected to the equivalent HTTPS url.
2. Requests with any other http method will fail with a 400.
2014-09-15 13:07:30 -07:00
jacalvar 775a780f49 [Fixes #739] Attribute Routing: Multiple routes per-action
1. Support multiple [Http*] attributes on an action.
2. Support multiple [Route] attributes on a controller and on an action.
3. Support creating multiple attribute routes using [AcceptVerbs("...", Route = "...")]
4. Detect attribute routed actions during action discovery and return one action per [Http*],
   [Route] or [AcceptVerbs] attribute found on the method when there is at least one valid attribute route.
5. Merge all the HTTP methods of [Http*] and [AcceptVerbs] attributes in a method during
   action discovery when there are no valid attribute routes defined on the action.
6. Build one action descriptor per controller [Route] + action [Http*], [AcceptVerbs]
   or [Route] combination in an action.
7. Disallow the use of attributes that do not implement IActionHttpMethodProvider and
   IRouteTemplateProvider simultaneously in methods that define attribute routed
   actions and throw an exception during startup.
8. Disallow mixing attribute routed and non attribute routed actions on the same method
   and throw an exception during startup.
2014-09-12 14:43:19 -07:00
harshgMSFT 7a3dc352c9 1. Moving the HttpNotAcceptableOutputFormatter to product code.
2. Renaming the NoContentFormatter to HttpNoContentOutputFormatter.
3. Updating the test to use mock.
2014-09-12 14:14:44 -07:00
harshgMSFT e884a476e9 Responding to comments 2014-09-12 13:56:33 -07:00
harshgMSFT abf27d883f GetSupportedContentTypes to take in declared and runtime type. 2014-09-12 13:56:30 -07:00
harshgMSFT 7448bf2843 Responding to comments 2014-09-12 13:56:22 -07:00
harshgMSFT 33173d3031 Fix for Content negotiation should fallback to the first formatter that can write the type #1033
- Includes functional and unit tests.
2014-09-12 13:56:14 -07:00
Chris Ross 85ad1aeb96 Handle IBuilder rename to IApplicationBuilder. 2014-09-10 14:12:08 -07:00
jacalvar cde1a95d49 [Fixes #900] Use [Route(...)] on action methods to specify an attribute route that allows all verbs.
1. Changed attribute usage on RouteAttribute.
2. Added a test on action discovery to ensure that actions with [Route] get discovered as
   attribute routed actions.
3. Added a test on reflected action descriptor provider to ensure that an action with [Route] on
   the controller and [Route] on the action results in an action that allows any Http method.
2014-09-10 10:11:42 -07:00
jacalvar 9345afeed2 [Fixes #731] Add unit tests for ReflectedActionDescriptorProvider
1. Added tests that cover parameters in actions.
2. Added tests that cover building the reflected application model.
3. Added tests that cover attribute routed action constraints and default values.
4. Added tests that cover conventionally routed action constraints and default values.
5. Refactored and cleaned up ReflectedActionDescriptorProvider. All the refactors consist
   of extracting blocks of code to separate methods to better display the flow when building
   the action descriptors.
2014-09-09 14:03:05 -07:00
David Fowler 34add2249e Updated to use the new target framework in project.json 2014-09-04 02:02:40 -07:00
jacalvar b6fb7ac7df Take advantage of nameof to improve our usage of MemberData across the code base.
Substituted all instances of [MemberData("PropertyName")] for [MemberData(nameof(PropertyName))]
This change enables us to take advantage of IDE features like Navigate to source,
find all references, etc. When using Visual Studio.
2014-09-02 13:53:03 -07:00