Commit Graph

135 Commits

Author SHA1 Message Date
Ryan Nowak df8f84b772 Fix #1287 - Port WebAPI parameter binding behavior
This change modifies the default parameter binding behavior for an
ApiController to use the WebAPI rules.

'simple types' default to use route data or query string
'complex types' default to use the body (formatters)

Adds ModelBindingAttribute to enabled model binding
2014-10-17 16:51:48 -07:00
sornaks 5b1bcb6079 Issue #1214: Cannot pass a int parameter to the views from ViewComponent.
Fix: Checking if the model is not null in the Copy constructor of ViewDataDictionary.
2014-10-17 16:40:25 -07:00
Harsh Gupta 75405e3b76 Adding support for bind attribute. 2014-10-17 16:24:28 -07:00
jacalvar 98d749d03c [Fixes #1389] Can't bind complex type data from route parameters.
Changed DictionaryBasedValueProvider to do a prefix check instead of just checking if the underlying
dictionary contains the key.
2014-10-17 15:32:21 -07:00
Pranav K 66f626b828 Remove unnecessary references from project.json 2014-10-17 14:26:58 -07:00
Pranav K 5119d16b64 ViewComponent.Invoke() should be able to invoke views
Fixes #285
2014-10-17 12:23:18 -07:00
Ryan Nowak 9fadcf74ca Fix for item #1278 - Add WebAPI ActionResult types and helper methods on
ApiController

Ports all of the WebAPI action result types.
2014-10-16 19:33:49 -07:00
jacalvar 8966680075 [Fixes #1332] Port IContentNegotiator to WebAPI shim for CoreCLR support
1. Ported IContentNegotiator.
2. Enabled Core CLR configuration
2014-10-16 17:22:47 -07:00
sornaks 53379e4395 Issue #1206 - DefaultBodyModelValidator throws if get accessor throws.
Fix: The MvcOptions takes in a list of ExcludeFromValidationDelegate (Func<Type,bool>). This func verifies if the type is excluded in validation or not.
2014-10-16 16:09:30 -07:00
Stephen Halter a21ed4bc51 Replace calls to GetService<T> with GetRequiredService<T>
Even though GetService<T> still exists, GetRequiredService<T> preserves
the old behavior of throwing for missing services.
2014-10-16 14:51:41 -07:00
Harsh Gupta 8f933b2ac3 [Fixefor #860]- Adding Support for [FromFormData] [FromQuery] and [FromRoute],
also updates FromBody to use the new pattern for model binding.
2014-10-16 10:20:15 -07:00
Pranav K b2a01e7b45 Adding support for inheriting tag helpers from _ViewStart files
Fixes #1166
2014-10-16 07:55:37 -07:00
Kiran Challa acb2a99e9f [Fixes #1283] Add functional tests for WebAPI-style controllers returning HttpContent 2014-10-16 01:52:33 -07:00
Pranav K 75c6327b2e Layout property needs to be propogated between nested view starts
Fixes #1364
2014-10-15 18:54:02 -07:00
Pranav K de77c92a0a Reviving PartialViewResult and associated methods on Controller
Fixes #824
2014-10-15 18:28:08 -07:00
Ryan Nowak 5f47546d40 Use DefaultOrder in MvcOptionsSetup 2014-10-15 17:12:52 -07:00
sornaks 2c4b3dd3fc Issue #937: Adding functional tests for Filters. 2014-10-15 14:24:53 -07:00
Kiran Challa e985c22528 [Fixes #1216] Provide a property on JsonOutputFormatter to set serializer settings
[Fixes #1221] Rename OutputFormatter's WriteResponseContentHeaders to WriteResponseHeaders
[Fixes #932] Setting Json Serializer Settings
2014-10-15 09:27:09 -07:00
Harsh Gupta ebf64ce4e3 Adding HttpResponseException to WebApi Shim. 2014-10-15 09:07:40 -07:00
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
SonjaKhan 0f5bbdf417 updating ILogger, see aspnet/Logging#3 2014-10-14 10:25:01 -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 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
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
Pranav K ba6813a418 Support specifying paths starting with ~/ for layout and partial views
Fixes #821
2014-10-09 17:15:09 -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
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
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
Pranav K c0e077dcd4 Updating ConnegWebSite name in tests 2014-10-06 10:41:36 -07:00
Pranav K bf82d87758 * Updating path to functional test file and functional test references to
unblock Mono build
2014-10-06 10:30:26 -07:00
David Fowler 5890b5b254 Fixed up references 2014-10-05 13:24:00 -07:00
jacalvar 8802c831a0 [Fixes #1155] Added functional tests to cover common versioning scenarios. 2014-10-03 19:00:24 -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
Pranav K 12477c9f52 Changes to make EnableInstrumentation conditionally enabled 2014-10-02 17:55:40 -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