Commit Graph

90 Commits

Author SHA1 Message Date
Ryan Nowak bcde82cf62 Use buffer pooling in IOutputFormatters 2015-10-23 08:10:30 -07:00
Doug Bunting 40b7636b72 Use `ModelMetadata.GetDisplayName()` in error message replacing `FormatException` and `OverflowException`
- #3227
- much of change is to tests, creating and passing `ModelMetadata`
- updated `InputFormatterContext` to make `ModelMetadata` available to `JsonInputFormatter`
  - walk `ModelMetadata` tree to get information about property with an issue
- add missing `null` checks in `ModelStateDictionaryExtensions`
2015-10-22 15:50:36 -07:00
ryanbrandenburg da731fc641 Add logging to ActionResults and ControllerActionInvoker 2015-10-21 13:16:14 -07:00
Ryan Nowak 38b65875db Refactor of OutputFormattterContext 2015-10-20 18:05:57 -07:00
Pranav K 8b0c157296 Rename ModelState (the type) -> ModelStateEntry
Fixes #3326
2015-10-20 16:43:00 -07:00
Ryan Nowak 6985015e2d Fix test breaks in WebAPI shim
This hasn't hit universe yet, but these needed to change with the
ObjectResult refactor
2015-10-19 18:00:02 -07:00
Pranav K f57e180971 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:53 -07:00
Ryan Nowak 8a502dbe5d Rewrite of validation 2015-09-25 16:56:42 -07: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
Pranav K 7b433820b1 Changes per PR comments
Reformatting parameter identation
2015-09-17 15:42:58 -07:00
Ryan Nowak 046cb976b3 Move ActionResult classes back to main namespace 2015-09-16 21:42:31 -07:00
Doug Bunting 271e19e61a Remove use of `IsMono` to no-op a test
- use `[ConditionalFact]` or `[ConditionalTheory]` instead
  - in some cases test was already conditional
- move other `IsMono` checks into data sets where possible
  - not reported as skipped but at least not counted as successful

nit: switch from `[ConditionalTheory]` to `[ConditionalFact]` as appropriate
- slightly more efficient since xUnit won't check for data
2015-09-10 11:55:51 -07:00
Ryan Nowak 382c9ab86a Test Cleanup: Fix Assert.NotNulls with ModelBindingResult 2015-09-07 17:15:31 -07:00
Ryan Nowak 076ce6a8a1 Make ModelBindingResult a struct. 2015-09-03 12:52:50 -07:00
Hao Kung 3ebdcc5f6f React to options changes 2015-09-02 14:07:06 -07:00
Ryan Nowak 229724c4ea Reorganize MVC namespaces 2015-09-01 22:28:33 -07:00
Chris R f2db0d1483 React to string[] -> StringValues changes. 2015-08-28 16:36:19 -07:00
Ryan Nowak 1596cd9422 Fix #2527 - Remove FormCollection use
This removes the dependency on Microsoft.AspNet.Http from the Mvc.Core
code. Added the reference back to tests where needed (DefaultHttpContext).
2015-08-24 11:09:30 -07:00
Ryan Nowak 89a8d0e36c Remove IScopedInstance - use AsyncLocal for ActionContext and
ActionBindingContext

This change replaces IScopedInstance<T> in favor or IActionContextAccessor
and IActionBindingContextAccessor. In the spirit of IHttpContextAccessor,
these are both singletons which use AsyncLocal for storage.

This change allows the invoker factory to be cached which results in some
significant perf gains.
2015-08-13 15:58:29 -07:00
Doug Bunting 83a559c28c Add `ModelValidationNode`s consistently
- #2633
- do not leave `ModelBindingResult.ValidationNode` as `null` when we hit the `null` `RawValue` special case
 - move two bits of code together to make the special case more obvious
- add `ModelValidationNode` (that suppresses validation) when `HttpRequestMessageModelBinder` is successful
 - also suppress validation of `HttpRequestMEssage` properties
- suppress validation in `CancellationTokenModelBinder`, `FormCollectionModelBinder`, `FormCollectionModelBinder`
- do not create a `ModelValidationNode` when validation fails in `TypeConverterModelBinder`

nits:
- improve some doc comments
- add a quick `HttpRequestMessageModelBinderTest`
2015-08-11 08:30:29 -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 0b50bfe03c Move Moq to framework-specific dependencies
New builds of dnu/VS are complaining about this.
2015-07-13 16:12:09 -07:00
Ryan Nowak ccb2f2deda React to move of StatusCodes 2015-07-08 12:43:33 -07:00
Ryan Nowak 950b8b41a8 Rename IFilter -> IFilterMetadata 2015-07-06 23:40:43 -07:00
sornaks 68523a3550 Fixing tests in Mono.
- Disabling tests which have corresponding bugs in mono.
- Fixing a few tests which do not handle *nix file system.
- Updating Travis configuration to use mono's alpha bits.
- Introducing PlatformNormalizer to normalize content across multiple platforms.
2015-07-02 17:24:14 -07:00
Ajay Bhargav Baaskaran e2787b3b84 [Fixes #2715] Removed formatter dependency from JsonResult and JsonViewComponentResult 2015-06-25 14:09:32 -07:00
Ryan Nowak a679e87a9b Split Mvc.Core
This is the first step is some more refactorings to come in the future
with the goal of making MVC less monolythic. This makes the core of MVC
more reusable and more in line with the design of other vNext platform
components.

With this change, Mvc.Core contains just the minimal guts needed to build
a working app.
- Action Discovery
- Action Invoker
- Filters
- ObjectResult
- Model Metadata
- Model Binding
- Formatters
- Validation System

And yes, we are aware of the irony of 'minimal MVC' not including the view
system. The idea is that this is the kernel of an MVC app, and anything
real is layered on top.

The most noticable impact of this change is that MvcOptions has been blown
apart into more managable chunks. See the various ConfigureMvc*** methods.

The new Mvc.Extensions package is a placeholder while we evaluate and tune
the new definitions. Expect more changes as features are move to their own
packages, and in some case their own repositories.

For now there is no experience to bootstrap an Mvc.Core app. That's coming
next.
2015-06-09 02:12:13 -07:00
Ryan Nowak 6cd277e8aa Refactor I***ModelBuilder extensibility
Combining IControllerModelBuilder and IActionModelBuilder into a pipeline
of IApplicationModelBuilders. Extensibility for framework features (Auth,
Cors, etc) should implement an IApplicationModelBuilder to add data to
models before IApplicationModelConventions have a chance to run.

Also deleting IGlobalFilterProvider while touching this code, this should
have been removed a while ago when we removed other options facades.
2015-06-07 18:07:41 -07:00
Ryan Nowak 39fe063aee Fix #2330 - Reimagine *FormatterContext
This change simplifies InputFormatterContext/OutputFormatterContext by
swapping ActionContext for HttpContext.

This change is important especially for InputFormatterContext as it
decouples ModelState from ActionContext - allowing us to fix a
related bug where the _wrong_ ModelState can be passed in for a
TryUpdateModel operation.
2015-05-12 11:05:56 -07:00
Chris R bd03142dab React to Http namespace changes. 2015-05-07 15:19:10 -07:00
N. Taylor Mullen 64e726d2b2 Update LICENSE.txt and license header on files. 2015-05-01 13:55:25 -07:00
Henk Mollema 955b45f995 Utilized `nameof()` for `ArgumentNullException`s
Utilized the use of nameof() operator for ArgumentNullExceptions.
2015-04-24 14:00:34 -07:00
Chris Ross 6223aac9be Handle Http.Core rename. 2015-04-16 15:48:27 -07:00
Kiran Challa c3f10f4a0f Logging for content-negotiation 2015-04-16 12:02:55 -07:00
Kiran Challa 65bd8c448a Removed Logging related ILogValues types and cleaned up tests. 2015-04-16 11:19:20 -07:00
Kiran Challa 20daab2fb5 Removed direct dependency on Framework.Logging and instead used Framework.Logging.Interfaces.
Fixed breaking code which additionally cleans up start-up logging which we wanted to do.
2015-04-16 11:19:17 -07:00
Harsh Gupta 58a5ad2279 Adding Outputformatter in resource filters. 2015-04-08 16:46:46 -07:00
Pranav K f9d53e341c * Simplify MvcOptions
* Remove facades for accessing Options<T> and pass options to the invoker

Fixes #2266
Fixes #2269
2015-04-07 14:45:53 -07:00
Doug Bunting f3ec6f33ae Merge remote-tracking branch 'origin/release' into dev 2015-04-03 12:08:11 -07:00
Doug Bunting 7916cb9c68 Add a few more `<Service/>` items 2015-04-02 22:55:21 -07:00
Doug Bunting 393aa54545 Update .xproj files for Microsoft.Web.AspNet.* -> Microsoft.DNX.* rename 2015-04-02 13:49:27 -07:00
N. Taylor Mullen 2de7c173ab Add travis and appveyor CI support. 2015-04-01 15:53:39 -07:00
Doug Bunting 4d4686147f Let VS do its thing
- newline after BOM and slight reordering of Mvc.sln
- add `Service/Include` properties to some test .xproj files
 - also add BOM in a few cases
2015-03-28 14:41:40 -07:00
Harsh Gupta ac908d405e Removing ModelMetadataProvider.GetModelMetadataForParameters 2015-03-19 16:42:54 -07:00
N. Taylor Mullen 385fa29407 Update xunit.runner.kre => xunit.runner.aspnet. 2015-03-12 18:01:41 -07:00
N. Taylor Mullen c1a026cbf7 Update .kproj => .xproj. 2015-03-11 14:01:43 -07:00
N. Taylor Mullen 1d578ca2fd Remove BOM from project.json, *.cmd, *.sh and *.shade files. 2015-03-09 12:56:42 -07:00
N. Taylor Mullen e829ba7646 Update aspnet50/aspnetcore50 => dnx451/dnxcore50. 2015-03-08 12:52:24 -07:00
Pranav K ed3f5118e3 Reacting to NullLoggerFactory removal 2015-02-26 17:52:50 -08:00
Yishai Galatzer ed8e5716ea Remove INestedProviderXXX
React to aspnet/DependencyInjection#179
2015-02-23 15:18:39 -08:00