Commit Graph

852 Commits

Author SHA1 Message Date
Harsh Gupta 5a83383179 Adding ApiController.Validate : Fixes #1286 2014-10-10 13:42:06 -07:00
Ryan Nowak 22869b41c0 Fix issue #1280 - Add HttpResponseMessageFormatter
Adds a formatter that can convert an HttpResponseMessage returned from an
action into HttpContext.Response output.
2014-10-10 13:42:02 -07:00
Ryan Nowak aad3ae42ca Fix for issue #1281 - Add ModelBinder for HttpRequestMessage
This change adds a ModelBinder that can bind an HttpRequestMessage to an
action parameter.

This builds on an earlier change to construct and store the request
message in the HttpContext via an http feature.
2014-10-10 13:41:59 -07:00
Ryan Nowak e51e0e1d52 Fix for issue #1279 - Add .Request property to ApiController
This change adds a .Request property to the ApiController class that can
be used to access an HttpRequestMessage wrapping the HttpContext.

The HttpRequestMessage is stored in an http feature to make it accessible
to model binders and other infrastructure.
2014-10-10 13:41:55 -07:00
Ryan Nowak 9b11c1d90f Fix #1276 - Implement WebAPI action conventions and overloading
This change adds ApplicationModel conventions that can enable WebAPI
action conventions (verb mapping) and WebAPI overloading.

The conventions activate when a controller has a marker attribute.
ApiController has this attribute, so any ported code will automatically
opt-in.

Also ported some old tests for action selection to our new functional test
framework.
2014-10-10 13:41:50 -07:00
Ryan Nowak 2578b8107f Fix for #1277 - Add Options/Startup API for WebAPI shim
Adds an options class, as well as a default options setup that will
configure the default set of formatters.

Currently most of what options needs to do is a placeholder, but it later
do things like add ApplicationModelConventions, filters, formatters, model
binders, etc. Those will be added in follow up items.
2014-10-10 13:41:46 -07:00
Ryan Nowak d9fe305802 Fix for #1275 - Adding ApiController
This change includes the basic properties that we're providing for
compatability as well as some functional tests and unit tests that verify
that ApiController can be a controller class.
2014-10-10 13:41:42 -07:00
Ryan Nowak f66345263d Add WebApiCompatShim project structure 2014-10-10 13:41:35 -07:00
Harsh Gupta e319fef5cb Adding CancellationTokenModelBinder. 2014-10-10 12:16:49 -07:00
Pranav K ad208442d8 Updating functional tests to restore CallContextServiceLocator.Locator.Service on test finish 2014-10-10 11:54:00 -07:00
Pranav K b19764d922 Reacting to CLR package versioning changes 2014-10-10 10:34:01 -07:00
NTaylorMullen fb6b1748a6 Move ITagHelperActivator DI registration.
- Moved the ITagHelperActivator registration in MvcServices to sit with the RazorPage pieces (it's used on the RazorPage).
2014-10-10 00:45:06 -07:00
YishaiGalatzer 275f63e91f Prevent Roslyn from loading prematurely on cold start 2014-10-09 23:34:02 -07:00
N. Taylor Mullen 75a77e2d01 Add tests to validate attribute value rendering.
- Exposed internals from Mvc.Razor.Host to Mvc.Razor.Test so it can use the MvcRazorHost override that takes the IFileSystem.
- Added end-to-end code generation tests for TagHelpers with ModelExpression properties.

#1241
2014-10-09 22:47:26 -07:00
NTaylorMullen 2005c3cd85 Add ModelExpression code generation.
- Sealed the ModelExpression.
- We use the stringified version of the ModelExpression type name to detect ModelExpression properties on TagHelpers. This is so the MvcRazorHost can work in tooling and in runtime.
- Created a GeneratedTagHelperAttributeContext to represent the specific stringified versions of the ModelExpression assets.
- Created an MvcTagHelperAttributeValueCodeRenderer to modify rendering of ModelExpression properties.

#1241
2014-10-09 22:47:25 -07:00
Ryan Nowak ad76a3c8fb Fixing a bad merge on Mvc.sln 2014-10-09 19:13:29 -07:00
YishaiGalatzer 80ef37ab0a Add unit tests to controller properties 2014-10-09 18:18:03 -07:00
Pranav K ba6813a418 Support specifying paths starting with ~/ for layout and partial views
Fixes #821
2014-10-09 17:15:09 -07:00
YishaiGalatzer 4baa2910b7 Add compatibility items for controller back from MVC 5 2014-10-09 16:42:39 -07:00
Hao Kung 6fe663951d Update new test to use UsePerRequestServices 2014-10-09 14:26:18 -07:00
Hao Kung b6bd7f5d78 React to UsePerRequestServices 2014-10-09 14:17:04 -07:00
N. Taylor Mullen c87de5a0fc Add TagHelper functional test.
- Added an end-to-end test that verifies all content behaviors, interactions and functionalities of tag helpers.
- Added some common user scenarios to verify that the system works how we expect.

#1116
2014-10-09 13:37:29 -07:00
N. Taylor Mullen b68fae9b8c Removed the TypeActivator from TagHelper creation.
- We now new up TagHelper's, requiring them to have parameterless constructors.
- Added test to validate throwing.
- Removed existing tests that expected the constructor injection behavior.

#1303
2014-10-09 12:48:20 -07:00
NTaylorMullen 3dff1ca410 Add ITagHelperActivator.
- The TagHelperActivator enables dependency injection via properties and allows access to the ViewContext.
- This replaces the ICanHasViewContext mechanism that we had in place before.
- Added tests and fixed up existing to work with new format for providing ViewContext.

#1258
2014-10-09 12:39:57 -07:00
Doug Bunting 05c35dd3ba Add missing access modifier 2014-10-09 12:39:45 -07:00
Doug Bunting 3492be3c6c Add copyright notices to new files 2014-10-09 12:39:32 -07:00
Doug Bunting 639a788ed8 Tag Helpers: add `ModelExpression` class to support `Expression<Func<TModel, TValue>>` attributes
- includes new `RazorPage<TModel>.CreateModelExpression<TValue>()` method
- #1240

nit:
- regenerating the resources reordered Microsoft.AspNet.Mvc.Core's Resources.designer.cs
2014-10-09 12:39:19 -07:00
Doug Bunting 3290791c5f Use nameof when initializing `GeneratedTagHelperContext`
nits:
- missing blank line before a comment
- cleanup line breaks in `RazorPage.CreateTagHelper`
2014-10-09 12:39:04 -07:00
Doug Bunting 9899cb336a Cleanup tabs in project.json files 2014-10-09 12:38:52 -07:00
NTaylorMullen e44e59fd29 Updated to work with latest Razor changes. 2014-10-09 12:38:42 -07:00
NTaylorMullen d041249b27 Add CreateTagHelper to RazorPage.
- The CreateTagHelper method is responsible for creating and activating TagHelpers.
- Added the support for requesting the ViewContext.
- Added tests to validate the tag helper creation mechanism.

#1104
2014-10-09 12:38:31 -07:00
N. Taylor Mullen 082512f63c Add writing scopes to RazorPage.
- RazorPage now has the ability to use writing scopes to control where things are written.
- This enables RazorPages to use these writing scopes with TagHelpers.  TagHelpers use them to buffer attributes that have C# contained within them and to also buffer content of TagHelpers whos ContentBehavior is Modify.
- Added RazorPage tests to validate their functionality.

#1102
2014-10-09 12:38:19 -07:00
NTaylorMullen e995e7a3e2 Configure host to utilize tag helper types.
- Set the appropriate GeneratedTagHelperContext properties to ensure code is generated correctly.
- Set the TagHelperDescriptorResolver.

#1165
2014-10-09 12:38:04 -07:00
N. Taylor Mullen 757441777e Use Microsoft.AspNet.Razor.Runtime project. 2014-10-09 12:37:54 -07:00
N. Taylor Mullen 24a12ba103 Use CodeBuilderContext instead of CodeGeneratorContext. 2014-10-09 12:37:38 -07:00
NTaylorMullen be4a6c8d98 Split FunctionalTests from Mvc solution.
- Created a solution that had everything the Mvc.sln had EXCEPT functional tests.
- Added Mvc.NoFun.sln.

#1227
2014-10-09 12:18:30 -07:00
Pranav K 95852c38c4 Reacting to DI changes 2014-10-08 20:08:59 -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
YishaiGalatzer ba1884aacb Make wait service not timeout without yelling, and making the timeout longer 2014-10-07 23:04:36 -07:00
YishaiGalatzer 67a30e491f Introduce default order for framework ordered items to be -1000 2014-10-07 21:43:50 -07:00
Ryan Nowak 8a3e64e164 fix doc error 2014-10-07 20:46:39 -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
N. Taylor Mullen 2670b19f5c Remove framework assembly versions. 2014-10-06 14:57:43 -07:00
Pranav K c0e077dcd4 Updating ConnegWebSite name in tests 2014-10-06 10:41:36 -07:00