Commit Graph

410 Commits

Author SHA1 Message Date
Hao Kung 448ac5a0dc React to options and hosting changes 2014-10-14 19:20:28 -07:00
jacalvar 1680616fe5 [Issue #1133] RedirectToActionResult and UrlHelper should use HostString, PathString, etc. To build Urls.
Added tests to describe the current behaviour with Unicode hosts.
2014-10-14 16:12:29 -07:00
sornaks 5fa8a91111 -Issue #913 - Model-binding is being case-sensitive when binding Url data to Enum parameter.
Fix: Using TypeConverter solves this problem.
-Issue #1123 - TypeConverterModelBinder cannot bind "byte" and "short".
Fix: Modified code to use TypeConverter which can handle these scenarios.
-Removing the GetConverterDelegate method and making the code similar to the WebApi.
2014-10-14 15:36:52 -07:00
Pranav K a41b9dc983 Add Html.Partial - sync versions of Html.PartialAsync
Fixes #1107
2014-10-14 15:15:50 -07:00
Pranav K d9ebb37906 Removing Microsoft.AspNet.Mvc dependency from ModelBinding 2014-10-14 12:22:29 -07:00
SonjaKhan 0f5bbdf417 updating ILogger, see aspnet/Logging#3 2014-10-14 10:25:01 -07:00
Kiran Challa dd587f743b [Fixes #1331] Dispose HttpResponseMessage once its written out in HttpResponseMessageOutputFormatter 2014-10-13 22:34:36 -07:00
Pranav K 4ec6da1ed3 Adding RenderSectionAsync to RazorPage
Fixes #845
2014-10-13 17:44:49 -07:00
jacalvar 39376617cc [Fixes #809] Multiple [Http*] verbs should create multiple actions 2014-10-13 15:25:53 -07:00
jacalvar 3f54492930 [Fixes #885] API Explorer: Link Generation
1) Expose the simplified relative path template by cleaning up constraints, optional and catch all tokens from the template.
2) Expose the parameters on the route template as API parameters.
3) Combine parameters from the route and the action descriptor when the parameter doesn't come from the body. #886 will refine this.
4) Expose optionality and constraints for path parameters. Open question: Should we explicitly expose IsCatchAll?
2014-10-13 15:20:38 -07:00
Pranav K a633ef4f97 Modify Razor components to use RazorViewEngineOptions.FileSystem
Fixes #1302
2014-10-13 14:34:31 -07:00
YishaiGalatzer 4166c8cbc9 Fix unit test 2014-10-13 10:13:32 -07:00
Pranav K d912f6cd39 Removing unused types
Fixes #1344
2014-10-13 05:15:26 -07:00
Pranav K 18e11f546d DecorateWriter does not get called for partial views rendered via
Html.PartialAsync

* Introducing StringCollectionTextWriter to buffer the contents of
  PartialAsync
* Ensure DecorateWriter is called for partial views

Fixes #1266
2014-10-12 14:24:29 -07:00
Pranav K 20eadb94ee Remove instrumentation from public API surface
Fixes #1262
2014-10-12 12:57:04 -07:00
YishaiGalatzer 75084ba0cd Move caching of compilation results to its own layer.
This will allow only creating the razor compilation when really needed, with the right lifetime.
2014-10-11 15:35:11 -07:00
YishaiGalatzer 13ee27c92c Rename IControllerAssemblyProvider to IAssemblyProvider and follow through resultant renames 2014-10-11 13:26:07 -07:00
Ryan Nowak 9ad3d5e68f Separate ApiControllers from MVC Controllers in routing 2014-10-10 13:42:12 -07:00
Ryan Nowak 3968df90e4 Fix issue #1282 - Add Request.CreateResponse extension methods
Adds the set of CreateResponse/CreateErrorResponse extension methods that
return an HttpResponseMessage.

For the overloads that perform content negotiation they will access the
collection of MediaTypeFormatters through the shim options. Note that
CreateResponse and friends use the OLD formatters.

Also, HttpError and CreateErrorResponse assume ErrorDetail == false. Using
the shim you will not get detailed error messages unless you construct the
HttpError instance yourself.
2014-10-10 13:42:09 -07:00
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
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
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 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 9899cb336a Cleanup tabs in project.json files 2014-10-09 12:38:52 -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
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
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