Commit Graph

75 Commits

Author SHA1 Message Date
N. Taylor Mullen 8499e3d6bb Remove direct Microsoft.NETCore.Platforms dependency.
- Microsoft.NETCore.App now pulls this package in.

aspnet/Coherence-Signed#344
2016-06-13 15:30:27 -07:00
Pranav K 8c8fd6446b Use regular PDBs on full desktop when possible
Add a test to verify exceptions thrown from views is pretty printed by diagnostics middleware

Fixes https://github.com/aspnet/Diagnostics/issues/293
Fixes #4737
2016-06-09 14:59:38 -07:00
Kiran Challa f1982bd987 Suppress default status code response type in api descriptions when explicit response types have been provided
[Fixes #4823] How to override the default (200) status code with ProducesResponseType
2016-06-09 12:07:52 -07:00
Doug Bunting 62803d5979 Serialize JSON using camel case by default
- #4283
- update `JsonSerializerSettingsProvider` to choose the `CamelCaseNamingStrategy`
2016-06-09 11:58:23 -07:00
Derek Gray 5a3875ea72 Alter content negotiation algorithm so that it can be configured (via
MvcOptions) to always respect an explicit Accept header. Fixes #4612.
2016-06-07 16:12:36 -05:00
Ryan Nowak 2e2784aa3d [Design] Split up MvcRouteHandler
This change splits up the conventional routing path from the attribute
routing path *inside* routing, instead of inside `MvcRouteHandler`. Each
attribute route group now gets its own instance of
`MvcAttributeRouteHandler` which just knows about the actions it can
reach.

This removes the concept of a route-group-token and removes the lookup
table entirely for attribute routing. This also means that the
`DefaultHandler` on `IRouteBuilder` will not be used for attribute routes,
which we are OK with for 1.0.0.

The action selector's functionality is now split into two methods. We
think this is OK for 1.0.0 because any customization of `IActionSelector`
up to now had to implement virtually the same policy as ours in order to
work with attribute routing. It should now be possible to customize the
selector in a meaningful way without interfering with attribute routing.
2016-06-07 08:12:47 -07:00
N. Taylor Mullen cfd58f1747 React to aspnet/Razor#705
- Updated `ScriptTagHelper` and `LinkTagHelper` to maintain their quotes on generated script tags.
- Removed `TagHelperOutputExtensions`. It's no longer needed.
- We no longer string replace quotes directly. We rely on encoding and the initial representation of an attribute to ensure quotes don't break generated attributes.
- Updated tests.
2016-05-27 12:00:01 -07:00
Pranav K 8ab66ab5ce Fix resource generation to work with dotnet test 2016-05-23 15:55:14 -07:00
Kiran Challa 93be3dee6e Fix FormTagHelper to set flag indicating generation of AntiforgeryToken
[Fixes #4595] Better error message with extraneous @Html.AntiforgeryToken
2016-05-20 04:29:01 -07:00
Kiran Challa 20a2e748ec Added ValueProviderFactories to ResourceFilterExecutingContext
This enables removing value provider factories from model binding(which is needed in some scenarios like large file uploads)
2016-05-20 04:15:07 -07:00
Pranav K 1de268d6a7 Remove DNX references from Microsoft.AspNetCore.Mvc.FunctionalTests
Fixes #4677
2016-05-19 12:09:19 -07:00
Pranav K 43c75c922e Allow functional tests with content to run from VS
Fixes #4543
2016-05-19 09:04:15 -07:00
Pranav K 61883b5101 Fix more schema warnings in Mvc 2016-05-18 18:25:45 -07:00
Kiran Challa 3c2bdfd368 Merge branch 'release' into dev 2016-05-03 12:29:33 -07:00
Doug Bunting e3db547011 Add `[Remote(routeName : "name")]` tests
- relates to #4445
- also relates to #4309 / fb07fee though restored and renamed files are slightly different
 - latest Unobtrusive version; copy just one file under `wwwroot`
- add JavaScript file and CDN links to enable manual testing of `[Remote]` tests in `BasicWebSite`
 - include renamed files for recreating the minimized JavaScript file manually
2016-05-03 12:25:00 -07:00
Kristian Hellang f4679fe74f Changed RequireHttpsAttribute to default to 302 instead of 301 2016-05-03 12:11:18 -07:00
Pranav K 3d494fd732 Merge branch 'release' into dev 2016-05-02 14:58:54 -07:00
Pranav K 36146a6139 Fix build warnings 2016-05-02 14:52:02 -07:00
Doug Bunting f05f6d5bd2 Quick fix: Simplify `OrderUsingHtmlHelpers.cshtml` layout
- intent was to make HTML helper output close to the tag helper output but source got over-complicated
- the output files for `Order.cshtml` and `OrderUsingHtmlHelpers.cshtml` now differ only in attribute order
 - i.e. HTML helpers output attribute alphabetically while tag helpers output them in order added
2016-05-02 12:55:11 -07:00
Pranav K 92408a5c22 Move samples to Entropy
Partial fix to #4449
2016-05-02 10:06:17 -07:00
Ajay Bhargav Baaskaran e74aa54d95 React to aspnet/Razor#738 2016-04-27 16:54:16 -07:00
Doug Bunting d8d2e54506 Remove extra options to manipulate `JsonSerializerSettings`
- #4339: remove non-recommended JSON formatter constructors
 - affects `JsonInputFormatter`, `JsonOutputFormatter`, `JsonPatchInputFormatter`
 - `JsonOutputFormatter` cleanup also impacts `JsonHelper`
 - rename and make `SerializerSettingsProvider` class public; use it as appropriate
- #4409: make `SerializerSetings` properties get-only and `protected`
 - affects `JsonInputFormatter`, `JsonOutputFormatter`

Recommended patterns:
- change `JsonSerializerSettings` values in `MvcJsonOptions` for almost all customizations
- find `JsonOutputFormatter` in `MvcOptions.OutputFormatters` when limiting per-result formatters
- start with `JsonSerializerSettingsProvider.CreateSerializerSettings()` when customizing a per-result formatter
2016-04-27 14:48:16 -07:00
ryanbrandenburg e915f36748 Update samples and test sites to new formats 2016-04-25 12:09:40 -07:00
Pranav K d87d8283d0 Use latest build of dotnet-test-xunit 2016-04-19 14:54:07 -07:00
Pavel Krymets e6ffb060f7 Bring Microsoft.NETCore.Platforms dependency back 2016-04-18 17:20:15 -07:00
Pavel Krymets 42c3397b6e Migrate tests, tools and samples to portable 2016-04-18 17:20:15 -07:00
Doug Bunting 7a1ac034f9 Special-case use of `razorPage.Model` property in `ExpressionMetadataProvider`
- #3978
- better-aligns `ExpressionMetadataProvider` with `ExpressionHelper`

nit: mock less in `RazorPageCreateModelExpressionTest`
2016-04-15 17:15:33 -07:00
Sébastien Ros f30f61f7bb Fixing functional test random failure (#4452) 2016-04-12 10:44:26 -07:00
Doug Bunting a0c8834c70 Preserve existing metadata in `ViewDataDictionary` where possible
- #4116
- generalize rules for `ModelMetadata` creation; minimize metadata changes when Model is updated
 - down to a single special case in VDD for `Nullable<T>`
 - note existing functional tests did not need to change
- remove `ViewDataDictionary(ViewDataDictionary, object)` constructor; use `new VDD<object>(source, model)`
- allow all `Model` assignments in a view component
 - copy-constructed VDD in `ViewComponentContext` previously preserved the source's declared type

nits:
- do not call `virtual SetModel()` method from constructor; now mostly redundant
 - logic in copy constructor and `SetModel()` is consistent but different enough to keep code separate
- add some missing doc comments
- fix doc comment property versus type confusion; never need to specify `ViewDataDictionary.` prefix
- fix a few `TemplateBuilder` comments and remove unnecessary `model: null` argument to VDD constructor
2016-04-08 14:44:36 -07:00
jacalvar 574ecbb3eb [Fixes #4087] Add support for AddTagHelpersAsServices()
* Added TagHelperFeature and TagHelperFeatureProvider to perform tag helper discovery.
* Changed tag helper discovery to use application parts when using tag helpers as services.
* Added FeatureTagHelperTypeResolver to resolve tag helper type definitions from the list of application parts.
* Added AddTagHelpersAsServices extension method on IMvcBuilder and IMvcCoreBuilder that
  performs tag helper discovery through the ApplicationPartManager and registers those tag helpers as
  services in the service collection. Assemblies should be added to the ApplicationPartManager
  in order to discover tag helpers in them in them. The @addTagHelper directive is still required on
  Razor pages to indicate what tag helpers to use.
2016-04-02 10:32:48 -07:00
jacalvar f638c051fa Remove IAssemblyProvider and update DNX to work with application parts.
* Remove IAssemblyProvider.
* Remove DefaultAssemblyProvider in favor of DefaultAssemblyPartDiscoveryProvider.
* Update AddMvcDnx to add the list of DNX discovered assemblies to the list of application parts.
2016-04-01 11:01:09 -07:00
jacalvar 5246125cb7 [Fixes #4087] Add AddViewComponentsAsServices() and ServiceBasedViewComponentActivator
* Added ViewComponentFeture and ViewComponentFeatureProvider to perform view component discovery.
* Changed view component discovery to use application parts.
* Changed ViewComponentDescriptorProvider to make use of Application parts.
* Added AddViewComponentsAsServices method on IMvcBuilder that performs view component
  discovery through the ApplicationPartManager and registers those view components as
  services in the service collection. Assemblies should be added to the ApplicationPartManager
  in order to discover view components in them in them.
2016-04-01 10:55:04 -07:00
jacalvar 0d0aad41f5 [Fixes #4014] Add overload to AddControllerAsServices that uses the default controller discovery logic.
* Added ControllerFeature and ControllerFeatureProvider to perform controller discovery.
* Changed controller discovery to use application parts.
* Changed ControllerActionDescriptorProvider to make use of Application parts.
* Simplified AddControllerAsServices to not accept any parameter and perform
  controller discovery through the ApplicationPartManager in the IMvcBuilder
  and IMvcCoreBuilder. Assemblies should be added to the ApplicationPartManager
  in order to discover controllers in them.
2016-04-01 09:29:37 -07:00
jacalvar 1bd66ffda0 [Fixes #4089] Add support for application parts
This commit introduces application parts as a concept on MVC.

An application part is an abstraction that allows you to expose some
feature or corncern in a way that is decoupled from their underlying source.
Examples of this include types in an assembly, emdeded resources, files on
disk etc.

Application parts are configured during startup by adding or removing them from
the application part manager available as part of IMvcBuilder and IMvcCoreBuilder.

The application part manager provides the ability to populate features from the
list of available application parts by using a list of application feature providers.
Application feature providers are responsible for populating a given feature given a
list of application parts.

Examples of application providers can be a ControllerFeatureProvider
that goes through the list of application parts, sees which one of those parts exposes types,
determines which of those types are controller types, and adds them to a ControllerFeature
that holds a list of all the types that will be considered controllers in the application.
2016-03-31 12:14:04 -07:00
jacalvar de9ffb13c7 [Fixes #3732] Simplify controller discovery.
* Introduce ControllerAttribute and use it to mark base classes as controllers.
* Changed rules for controller discovery to:
  * All controller types must be public, concrete, non open generic types.
  * NotController attribute is not applied to any type oif the hierarchy.
  * The type name ends with controller.
  * Controller attribute is applied to the type or to one of its ancestors.
2016-03-31 10:50:26 -07:00
Kiran Challa 6e9a6a2db1 Added new attribute ProducesResponseTypeAttribute to enable ApiExplorer to expose response type and StatusCode.
[Fixes #4101] StatusCode Metadata
2016-03-30 11:51:58 -07:00
David Fowler 5ddb17d2fe Fixed packages 2016-03-25 12:27:49 -07:00
Pranav K 06289945d0 Reacting to CoreCLR package changes 2016-03-22 14:49:43 -07:00
Pranav K f651f18d3a Use a prefix tree as a backing store for ModelStateDictionary 2016-03-17 10:09:36 -07:00
Pranav K 432cfa0035 Fix failing functional tests 2016-03-16 20:33:41 -07:00
Ryan Nowak fec1268bf3 Remove ModelBinding features from ResourceFilters
Removes all of the ModelBinding configuration support from Resource
Filters. We haven't come up with concrete scenarios around these features,
and don't want to paint ourselves into a corner with extensibility.
2016-03-16 16:33:14 -07:00
Pranav K bf1fc7dab3 Reacting to Hosting changes 2016-03-15 10:50:53 -07:00
Pranav K 4f709bdbfd Fixing CI build break 2016-03-14 00:38:17 -07:00
Doug Bunting ffe2d2609a Correct HTML and JavaScript encoding of `<link>` and `<script>` attribute values
- #4083
- `<link>` tag helper did not HTML encode `href` values in fallback elements
- `<script>` tag helper did not correctly encode any attribute value in fallback elements
 - e.g. double quotes in literal strings would slip through
- only needed to change one existing unit test (!!); so added a bunch

nit: use `Process()`, not `ProcessAsync()` in `<script>` tag helper tests
2016-03-11 20:07:32 -08:00
ryanbrandenburg f1fa1bd8f4 * Remove JsonViewComponentResult 2016-03-11 11:40:54 -08:00
jacalvar 6b369ef291 [Fixes #4102] DefaultHtmlGenerator should attempt to properly format values for `<input type="date">` and `<input type="time">` 2016-03-09 17:22:02 -08:00
N. Taylor Mullen 5612ca845f React to aspnet/Razor#684.
- Modified `UrlResolutionTagHelper` to utilize new CSS selector attributes to restrict when it applies. It now only appies to tags that have their values starting with `~/`.
- `UrlResolutionTagHelper` no longer applies to dynamic content such as `href="@SomethingResultingInTildaSlash"`.
- Updated tests to reflect new behavior.
2016-03-08 12:17:16 -08:00
Pranav K f3740b2196 Reacting to KoreBuild xunit test changes 2016-03-07 21:09:19 -08:00
Pranav K 7bd7b32fcb Reacting to Localization CookieName change 2016-03-04 10:33:50 -08:00
Doug Bunting b35922e373 Remove project name from output path
- aspnet/Coherence-Signed#187
- remove `<RootNamespace>` settings but maintain other unique aspects e.g. `<DnxInvisibleContent ... />`
- in a few cases, standardize on VS version `14.0` and not something more specific
2016-03-02 14:39:12 -08:00