Commit Graph

1048 Commits

Author SHA1 Message Date
Ryan Brandenburg 8832014516 PackageTarget->AssetTarget 2017-06-14 15:03:43 -07:00
Pranav K a5f3a6425e Remove TaskCache and TaskCacheOfT 2017-06-08 08:19:20 -07:00
Nate McMaster 945661ad0e Remove unused test sample project (#6368) 2017-06-06 15:56:31 -07:00
Kiran Challa 0f0cfdfe94 Removed unnecessary package references 2017-06-01 12:02:05 -07:00
Pranav K 597a0c9a11 Add support for friendly routes in pages
FIxes #6325
2017-05-26 14:29:00 -07:00
Ryan Brandenburg 9ea37a1bbb Fix TFM build breaks 2017-05-25 13:12:39 -07:00
Ryan Brandenburg 03404cd3df Return to NetStandard 2017-05-25 10:34:16 -07:00
Ryan Nowak c1dd95be2a Add a test for #6294
This case was fixed by 2992f8e - this commit just adds a test to verify
the fix.
2017-05-24 16:53:30 -07:00
Jass Bagga e681c23d5c Add ITagHelperComponentManager (#6302)
Addresses #6282
2017-05-23 13:22:15 -07:00
Jass Bagga 9aff0a67c1 Range support for FileResult(#6150)
Addresses #3702
2017-05-19 10:51:46 -07:00
Ryan Nowak b2d95ffb21 Remove usage of NotFoundProjectItem
We're making this type internal in Razor, using a mock here is fine.

Also renamed some types with a generic name. The actual 'default'
RazorProject class lives in Razor and is internal.
2017-05-12 15:55:36 -07:00
Ajay Bhargav Baaskaran 5eabae55cb Added PushWriter and PopWriter to RazorPageBase
- Removed WriteXYZTo methods
2017-05-11 15:21:42 -07:00
Pavel Krymets cf64b335f6 Remove unnecessary package references (#6252) 2017-05-10 12:06:10 -07:00
Steve Sanderson debc3dd433 Functional test to show FSharpAsync works end-to-end (#6240) 2017-05-08 19:30:01 +01:00
John Luo 3164046233 Merge branch 'rel/2.0.0-preview1' into dev 2017-05-05 20:00:12 -07:00
John Luo f0a26a7f08 Migration2 2017-05-05 19:59:45 -07:00
Steve Sanderson a80594d706 Add FSharpWebSite plus simple functional test against it (#6231) 2017-05-05 19:08:36 +01:00
Pranav K 64ffcfaa89 Merge pull request #6236 from aspnet/rel/2.0.0-preview1
Change TFM to netcoreapp2.0 (#6234)
2017-05-04 22:18:48 -07:00
Pranav K 1c5e417606 Change TFM to netcoreapp2.0 (#6234)
* Change TFM to netcoreapp2.0
2017-05-04 18:11:26 -07:00
Steve Sanderson 6f3a295041 React to new ObjectMethodExecutor in Common 2017-05-03 15:40:02 +01:00
N. Taylor Mullen 8bece90c83 Fix asp-page-handler to generate form tags correctly.
- Prior to this change using asp-page-handler on its own did not create correct `<form>` elements. There were multiple issues, one as that the `FormTagHelper` would purposefully drop into a no-op code path. Second is the `DefaultHtmlGenerator` didn't call through to the `UrlHelper` correctly.
- Added functional test cases to validate asp-page-handler can live on its own on a form tag. This also included adding a variant where method="post".
- Added a `FormTagHelper` unit test to validate the `PageHandler` property is consumed properly.

#6208
2017-04-27 10:32:04 -07:00
Ryan Nowak b1b3a816cc Rename View() to Page()
This requires us to introduce another base class between RazorPageBase and
Page - you need this because you aren't allow to have Page.Page().
2017-04-27 09:27:14 -07:00
N. Taylor Mullen f165914b40 Update how `FormTagHelper` handles `get` method attributes.
- Added functional test to verify `asp-*` attributes on form taghelpers work as expected.
- Added a unit test to validate `FormTagHelper` behaves as expected.
- Moved `Method == "get"` checks into appropriate code paths. These include the one where a user specifies an empty or non-existent `action` attribute and where a user doesn't utilize any `asp-*` attributes. In the later, we default `Method` to `"get"` if it's not provided.

#6006
2017-04-25 15:17:15 -07:00
Ryan Brandenburg 42b988ad88 ./ paths relative on page. 2017-04-25 11:57:58 -07:00
Pranav K 649ee4d28d Add support for page handler to URL generating APIs. 2017-04-24 22:56:58 -07:00
N. Taylor Mullen ef0333ac6a Add Antiforgery to the FormTagHelper pre-check for processing.
- Added a test case to the HtmlGeneration functional test (the one verifying complex FormTagHelpers).
- Added unit test verifying antiforgery behavior when it's the only provided parameter.

#6006
2017-04-24 21:46:54 -07:00
N. Taylor Mullen 5c8a161ace Change `FormTagHelper` to apply to all form tags.
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes.
- Added a unit test to validate that parameterless `FormTagHelper`s behave as expected.

#6006
2017-04-24 18:39:01 -07:00
Pranav K ccdaa5a729 Make /Pages the default root for pages.
Fixes #6184
2017-04-24 15:46:32 -07:00
Ryan Nowak 04fd762943 Rename form-action -> handler 2017-04-24 14:15:35 -07:00
Kiran Challa 68866f8716 Added functional tests for JsonPatch 2017-04-23 09:09:08 -07:00
Pranav K ca017eced2 Add page to AnchorTagHelper and FormTagHelper
Fixes #6088
2017-04-21 18:12:54 -07:00
Pranav K f568d3c2bc Support finding "sibling" pages when using RedirecToPage
Fixes #6083
2017-04-21 18:12:52 -07:00
Ryan Nowak 297196baa0 Design updates to handler methods and binding
Implements #6091, #6072, #6090, #5927
2017-04-21 17:29:25 -07:00
Ajay Bhargav Baaskaran 8eac7c2d6c [Fixes #6117] Added RedirectToPage overloads to Controller 2017-04-21 12:19:35 -07:00
N. Taylor Mullen 83faaebdb6 Upgrade Roslyn dependency to 2.0.0.
- Added C# 7 unit and functional test to validate features work end-to-end.

#6149
2017-04-21 11:41:31 -07:00
Pranav K 681b798a2e RedirectToPage doesn't trim /Index from URL
Fixes #6080
2017-04-20 11:15:45 -07:00
Ryan Nowak 4bf518b09b Fix #6140 - Allow linking between controller and page
The issue here is that route values used for action selection are
'global'. That means that pages need to have a 'null' route value for
'action' and controllers need to have a 'null' route value for pages. This
is the same way that areas work.

The fix is to move the 'merge' of route values up to a level where pages
and controllers can work together. Since ADPs use the russian-doll
pattern, the fix is to run this 'merge' in the controller ADP, but after
all of the ADs have been created.
2017-04-19 16:48:38 -07:00
Ryan Brandenburg c9bfd2296d Parity between Controller and Page/PageModel 2017-04-19 15:02:06 -07:00
Hao Kung 3e8cd1e7c9 MVC => Auth 2.0 2017-04-19 11:57:04 -07:00
Ryan Nowak a8eb5bee70 Implement view search for pages
The View Engine now needs to know about pages :(. This isn't ideal but the
view engine needs to know what set of search paths to use. This was
already hardcoded for controllers vs controllers + areas. It felt right to
further hardcode instead of introduce a wierd abstraction that we only
use.

Additionally pages use a view location expander to implement an ascending
directory search.
2017-04-18 16:11:24 -07:00
Pranav K 8fa95d66d4 Add support for suppressing inbound and outbound routing 2017-04-14 17:02:45 -07:00
Ryan Nowak ed3aa4d918 Adding functional tests for @namespace 2017-04-14 14:47:29 -07:00
Jass Bagga 3eae7cc393 Add AggregateExceptionTest (#6135)
Test for aspnet/Common#215
2017-04-14 14:20:31 -07:00
Pranav K 3474bdf776 RedirectToPage from a form-action handler includes the formaction
Fixes #6104
2017-04-12 09:27:08 -07:00
Ryan Brandenburg 59a3aade9b Fix [TempData] for PageModel's 2017-04-11 16:45:44 -07:00
N. Taylor Mullen 36e272fdc2 React to Microsoft.AspNetCore.Razor.Evolution => Microsoft.AspNetCore.Razor.Language.
aspnet/Razor#1169
2017-04-10 10:20:19 -07:00
Steve Sanderson 90acd055fe Make [FromBody] treat empty request bodies as invalid (#4750) 2017-04-10 16:55:14 +01:00
Pranav K 1e7972bd8f Add convenience methods for redirecting from a Razor Page back to itself
Fuxes #5953
2017-04-07 10:03:42 -07:00
Ryan Nowak 4032de064e Removing _PageStart.cshtml
Pages now also use _ViewStart.cshtml

Also contains some naming/text cleanup that was missed in the previous
commit.
2017-04-06 08:14:37 -07:00
Ryan Nowak c6e4609096 Getting rid of _PageImports
Pages will just use _ViewImports.
2017-04-06 08:14:37 -07:00
Pranav K 925ad75cdf Add convenience methods for redirecting to another Razor Page
Fixes #5956
2017-04-04 14:36:22 -07:00
Ryan Brandenburg e5ccac8bf6 Add functional tests for RazorPage routes 2017-04-04 11:14:52 -07:00
Hisham Bin Ateya fe3d45fad1 Adding AllowAnonymousToPage & AllowAnonymousToFolder
Fixes #5884
2017-03-31 20:17:31 -07:00
Steve Sanderson 4f351bd37c Add support for media type suffixes (#5273, #6032) 2017-03-31 10:20:43 +01:00
Doug Bunting 1672820e4e Add functional test covering an `IList<T>` property
- #5656
2017-03-29 12:32:06 -07:00
Jass Bagga eda5028cf4 Add TagHelperComponentTagHelper
Addresses #5728
2017-03-29 11:29:24 -07:00
Pranav K b22326323a Add properties to Page and PageModel
Fixes #6008
2017-03-28 13:26:38 -07:00
Pranav K e7101f248a Support model binding to Razor Pages properties on page and PageModel classes
Fixes #5952
2017-03-24 07:45:19 -07:00
Pranav K badb6ce8e5 Remove net451 as a cross-compile target 2017-03-22 06:32:50 -07:00
Ryan Brandenburg 66deaf0b3f Make test of @page/@model whitespace 2017-03-20 10:36:58 -07:00
Ryan Brandenburg e6cb639cc0 Add handler functional test 2017-03-20 10:05:29 -07:00
Ryan Brandenburg 270f66198f Remove Razor from projects 2017-03-17 15:00:39 -07:00
Jass Bagga 1197657e5b TempData property attribute
Addresses #5600
2017-03-16 16:34:35 -07:00
Nate McMaster 6f7717a381 Unify dependency versions to one file 2017-03-15 16:54:32 -07:00
Pranav K bee1a55cff Use RazorPagesOptions.RootDirectory when looking for page hierarchies.
Fixes #5915
2017-03-14 18:56:50 -07:00
Ryan Brandenburg 82d87df166 Fix warning as error 2017-03-14 12:44:57 -07:00
Ryan Brandenburg 365ae19c8b Add InvalidTagHelperIndexerAssignment to RazorPageBase 2017-03-14 10:04:15 -07:00
hishamco e44d875df4 Adding AuthorizePage & AuthorizeFolder without requiring a policy
Refactoring
2017-03-13 16:39:52 -07:00
Pranav K f7fd5114b3 Introduce MvcRazorTemplateEngine 2017-03-13 16:33:13 -07:00
Ryan Brandenburg 1c74e31715 Add tests for PageActionInvokerProvider (#5882) 2017-03-09 16:19:20 -08:00
Ryan Brandenburg 7f3f6957be Set path in DefaultPageFactory (#5911) 2017-03-09 16:15:43 -08:00
Ryan Brandenburg d9d280d1ef Make CookieTempDataProvider the default ITempDataProvider (#5892) 2017-03-07 16:04:47 -08:00
Ryan Brandenburg 4a20c849cb Add functional test for Page.View() (#5896) 2017-03-06 16:19:41 -08:00
Doug Bunting 3fe0b569d6 Fix tests on Windows with `core.autocrlf=input`
- #5907
2017-03-06 13:59:06 -08:00
Pranav K 145d27f9b3 Add a PagesOption type that allows configuring the root for Page file discovery
Fixes #5785
2017-03-03 17:20:07 -08:00
Ryan Brandenburg 85e28ae478 Trim quotes from template (#5838) 2017-03-03 09:52:36 -08:00
Pranav K 7cadb58e12 Add convenience extension methods for IPageApplicationModelConvention 2017-03-02 17:38:04 -08:00
N. Taylor Mullen acfad83aa6 Migrate to MSBuild
- thanx to @NTaylorMullen for initial conversion
  - e.g. AssemblyInfo.cs files were already minimized or removed :)
- allow `>=` RC3 CLI's to build and run MVC
- work around several dotnet migration issues; see #5482
- disable full .NET Framework runs of functional tests; see #5873
- remove `Microsoft.DotNet.InternalAbstractions` and `System.Xml.XmlDocument` dependencies
- remove project.json (!!), *.xproj, .notest, and web.config files

Redo earlier changes:
- apply test migration to .NET 4.5.2 in *.csproj world
  - see 63507c8 for previous, project.json work
- apply dependency version downgrade from 0097e40 in *.csproj world

Make other test-related changes:
- make Microsoft.AspNetCore.Mvc.TestDiagnosticListener a regular class library
- add support for `/p:GenerateBaselines=true` for functional and Razor.Host tests
- separate `GetCSharpTypeName_ReturnsCorrectTypeNames_ForOutParameter()` test
  - work around inability to deserialize a odd `ref` type
  - xUnit and vstest now serialize / deserialze test data more often
- skip poor test mentioned in #5768
- work around Microsoft/vstest#392
  - rename tests to avoid duplicates
- work around Microsoft/vstest#419
  - set up created `AppDomain`s with current `ApplicationBase`
2017-02-28 21:20:39 -08:00
Ryan Nowak e11e6b3be7 Add TempData property and some functional tests 2017-02-22 08:14:02 -08:00
Ryan Nowak 19331f9532 Adding some basic functional tests
I ran into a blocking issue where page handlers aren't picked up, so I
fixed it. Logging another issue to follow up with better tests for this.
2017-02-21 16:41:25 -08:00
Ryan Nowak 36e4dbe941 Adding a functional test project for Razor Pages 2017-02-21 08:25:30 -08:00
Doug Bunting 63507c8da9 Bump test projects up to .NET 4.5.2
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- update AppVeyor config so this framework version is available
- build tests for desktop .NET only on Windows
2017-02-21 07:15:36 -08:00
Nate McMaster 0097e40e46 Downgrade to stable packages 2017-02-15 14:23:48 -08:00
Pranav K 9f3dfd9819 Make RazorPages work E2E 2017-02-06 19:05:31 -08:00
Ryan Nowak b79f8384b0 Make some methods public for ViewCompilation. 2017-01-30 13:46:27 -08:00
Ryan Nowak 84d2e027f5 Use new Razor in MVC 2017-01-30 10:55:49 -08:00
Ryan Brandenburg 03cdd15e5c SaveTempDataFilter handle write to body 2017-01-27 10:54:00 -08:00
Doug Bunting cc584ada39 Remove extra lines in 1840d68 2017-01-26 08:20:52 -08:00
Andrei Ignat 1840d6823b Addresses #5694 (#5695)
* Add "
`Microsoft.AspNetCore.StaticFiles": "1.2.0-*"`
to project,json
Add
`app.UseStaticFiles();`
in the
`public void Configure(IApplicationBuilder app)`
from `Startup` class.

Addresses #5694
2017-01-26 08:18:19 -08:00
Kiran Challa 8ac6b6699f [Fixes #4945] Simple string returned by controller action is not a valid JSON! 2017-01-25 13:29:18 -08:00
Pranav K 24efd4268b Pin the version of RazorTooling packages to 1.1.0-preview4-final 2017-01-17 11:55:15 -08:00
Pranav K 2b50ec99df Updating to 4.4 CoreFx packages 2016-12-21 16:47:14 -08:00
Ryan Brandenburg b2340d327e Order IgnoreAntiforgeryTokenAttribute and add test 2016-12-12 14:55:36 -08:00
Pranav K cfa9631ce8 Resolve path traversals in RazorViewEngine
This change moves the onus of path resolution from individual IFileProvider instances to RazorViewEngine.

Fixes #5574
Fixes https://github.com/aspnet/MvcPrecompilation/issues/33
2016-12-08 11:20:06 -08:00
Ryan Brandenburg 8f8bf5af34 Seperate view and model for enum display 2016-11-30 11:13:38 -08:00
Steve Smith 34dd9472ba Comment typo (#5557) 2016-11-22 13:55:24 -08:00
Pranav K 3b4d8e2e3d Fix downgrade warnings during restore 2016-11-17 10:50:47 -08:00
Pranav K c5a5ba1fee Add support for updateable ActionDescriptorCollection
Fixes #5350
2016-11-17 10:08:38 -08:00
Pranav K b82969a557 Updating versions to 1.2.0-* 2016-11-09 14:18:46 -08:00
Doug Bunting 6d4361218e Add builder extensions to simplify use of `CookieTempDataProvider`
- #5515
2016-11-08 15:32:09 -08:00
Ajay Bhargav Baaskaran 7985121bab [Fixes #5207] Support IsIndexer for ViewComponent tag helpers 2016-11-03 16:50:22 -07:00
Pranav K 8ad7c19379 Remove references to Iddentity 2016-11-03 10:42:20 -07:00
Ryan Brandenburg 01b237dda9 Antiforgery goes at the end of filters 2016-11-02 16:50:27 -07:00
Kiran Challa 82b2e9c75c Added functional tests for Antiforgery related to setting no-cache headers 2016-11-02 16:29:34 -07:00
Ajay Bhargav Baaskaran c28ad48e98 [Fixes #5216] Make generic parameters work with ViewComponent tag helpers 2016-11-02 15:55:23 -07:00
Ajay Bhargav Baaskaran 5b9c01e54d Added a functional test for ViewComponent tag helpers
- Added Copyright ViewComponent tag helper
 - Added Dan ViewComponent tag helper
2016-10-21 16:17:13 -07:00
Pranav K a52d692de0 Updating to netcoreapp1.1 2016-10-13 11:21:09 -07:00
Pranav K ed1378a365 Revert "Updating to netcoreapp1.1"
This reverts commit 398a104810.
2016-10-12 16:09:12 -07:00
Pranav K 398a104810 Updating to netcoreapp1.1 2016-10-12 14:24:52 -07:00
jbagga 41f00eea23 Default Status Code for void types changed to 200
Fixes #4838
2016-10-06 14:39:04 -07:00
Kiran Challa de7cea4000 Getting RouteDataRequestCultureProvider from Microsoft.AspNetCore.Localization.Routing package 2016-10-04 12:39:57 -07:00
Pranav K 6d235e4ef5 Update partner package versions 2016-10-03 14:27:20 -07:00
Kiran Challa 89bd6dc1cd [Fixes #5212] Added a cookie based ITempDataProvider 2016-10-03 14:04:57 -07:00
cjrosa 60d600dd5c Issue #5310 (#5334)
* Issue #5310
2016-09-30 09:40:53 -07:00
Steve Smith 3866ee72e0 Fixing typos Dowload -> Download 2016-09-20 15:55:19 -07:00
Doug Bunting eee1a9fef4 Do not generate a validation summary when `excludePropertyErrors` unless specific model has an error
- #5209
- update affected `HtmlHelperValiationSummaryTest` and functional tests
- add `ValidationSummaryTagHelperTest` tests to cover related scenarios

##### Behaviour changes when no errors exist for the model:
###### Tag helper
``` html
<div asp-validation-summary="ModelOnly" class="order"><h3>Oopsie<h3></div>
```
previously generated
``` html
<div class="order validation-summary-errors"><h3>Oopsie</h3><ul><li style="display:none"></li>
</ul></div>
```
and now generates
``` html
<div class="order"><h3>Oopsie</h3></div>
```
###### HTML helper
``` c#
@Html.ValidationSummary(excludePropertyErrors: true, message: "Oopsie")
```
previously generated
``` html
<div class=\"validation-summary-errors\"><span>Oopsie</span>
<ul><li style=\"display:none\"></li>
</ul></div>
```
and now generates nothing (`@HtmlString.Empty`).
2016-09-08 15:36:47 -07:00
Ajay Bhargav Baaskaran 4677bf13fa Reverting accidental changes 2016-09-08 08:28:51 -07:00
Crystal Qian 05392cbf35 Added view component tag helper code generator. (#5195)
This addresses #1051. There is one more pull request that needs to be completed/merged (for `CompositeTagHelperDescriptorResolver` and friends). After that, runtime should work!
2016-09-07 20:30:09 -04:00
Kiran Challa f7ee16170c [Fixes #5161] Support running middleware pipeline as part of a resource filter 2016-08-30 09:26:04 -07:00
Ajay Bhargav Baaskaran a6a4b5369a [Fixes #5166] Support passing instance directly when invoking ViewComponents with single parameter 2016-08-26 16:33:42 -07:00
Kiran Challa ac98417398 ModelBinding: Remove IsReadOnly checks and add/update tests 2016-08-04 14:20:23 -07:00
jacalvar b56cab6414 Merge branch 'rel/1.0.1' into dev 2016-08-01 14:16:58 -07:00
jacalvar f0732e9e21 [Fixes #5038] HTTP Verbs mapping error GET and DELETE
When an action contained an attribute derived from HttpMethodAttribute,
doesn't specify an attribute route and there is also another attribute
extending HttpMethodAttribute that has a route defined on it; we ignored
the HttpMethodAttribute attribute without a defined route when building
the set of action selectors for the method.

This caused the resulting action to be unbounded and to accept requests
for other verbs not associated with it. The root cause of the problem was
that attributes override equality and do a field by field comparison but
ignore fields in the base classes of the type, so if an attribute is part
of a class hierarchy (like Http*Attributes) there might be two different
attributes that get considered equal.

The fix for the problem has been to change using Contains on a couple of
collections (that uses the equals method on the underlying object) and
check for the existence of the attribute on the collection directly by
using reference equality.
2016-08-01 12:49:23 -07:00
N. Taylor Mullen d60ed06c19 Add link tag attributes to generated fallback tags.
- Updated functional tests and link tag script to include modified extra attributes content.

#4084
2016-07-29 16:30:56 -07:00
jacalvar 7a3f24d49d [Fixes #4960] Action results returned from controller actions rendered as json instead of executed 2016-07-27 14:42:46 -07:00
Pranav K 5092e75387 Pin repo version to 1.0.1 2016-07-26 12:09:57 -07:00
Ajay Bhargav Baaskaran 4600100695 Added a test to verify ReflectionTypeLoadException 2016-07-25 12:06:16 -07:00
Ryan Nowak fb514d7ef8 Update versions to 1.0.1-*
Also adding a version number to TestConfiguration. This is not a leaf node
so it should have a version.
2016-07-21 09:55:28 -07:00
ivano scifoni b4677a44da #4847 Fix MapAreaRoute override existing area constraint (#4954)
*  #4847 Fix MapAreaRoute override existing area constraint
Modify Test project
Modify web test routing

* wrong field tested

* IntRouteConstraint expected

* Default for area route on Travel area

* Removed commented code
simplify constraintsDictionary area assign
renamed test method

* test name

* renamedd test to MapAreaRoute_DoesNotReplaceValuesForAreaIfAlreadyPresentInConstraintsOrDefaults
2016-07-11 10:53:33 -07:00
Doug Bunting 7430efa8cc One build to rule them all
- well, at least VS and command-line builds will share output
- part of aspnet/Coherence-Signed#277
2016-07-06 16:21:18 -07:00
Pranav K ccff37126f Removing extra imports from projects 2016-07-06 08:59:58 -07:00
Pranav K a1f4786695 Updating json files to pin versions and build files to pin KoreBuild 2016-06-27 13:51:10 -07:00
Pranav K cd7954a164 Updating to dev versions 2016-06-16 10:40:11 -07:00
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
Ryan Brandenburg 5339a3e0ce Add ExceptionHandled to ExceptionContext (#4825) 2016-06-09 15:22:11 -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
Ryan Nowak 31ec88526a Fix #4801 Rename ValidationExcludeFilter
'ValidationExcludeFilter' -> 'SuppressChildValidationMetadataProvider'

Also moved to .ModelBinding for improved discoverability. There aren't
many reasons user code would have a using for .Validation.
2016-06-09 10:51:31 -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
Hao Kung c15cf49a73 React to AuthZ API change 2016-06-03 13:30:53 -07:00
jacalvar 6a6d2e0d9f [Fixes #4506] Move and rename ActionDescriptor.Name to ControllerActionDescriptor.ActionName 2016-05-31 23:13:20 -07:00
Pranav K ab76f743f4 Use dependency context from all application parts when compiling views
Fixes #4498
2016-05-24 10:28:51 -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
BrennanConroy aeb5eb440c React to AuthorizationContext rename 2016-05-16 09:36:24 -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
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
jacalvar 4d02a03658 Merge branch 'release' into dev 2016-04-30 16:21:38 -07:00
jacalvar 4d198f3d8f React to changes in razor tooling 2016-04-30 15:37:37 -07:00
Stan 30ace9f35a [Fixes #4520] Fix typo in controller filename (#4532) 2016-04-28 12:06:11 -07:00
BrennanConroy fbd7110da0 Merge branch 'release' into dev 2016-04-27 18:38:50 -07:00
BrennanConroy df7be69e85 Remove references to UseDefaultHostConfiguration 2016-04-27 18:38:34 -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
Ryan Brandenburg 39f4b1fd91 Merge remote-tracking branch 'origin/release' into rybrande/dev 2016-04-26 10:18:48 -07:00
ryanbrandenburg e915f36748 Update samples and test sites to new formats 2016-04-25 12:09:40 -07:00
BrennanConroy 74a74fb3a8 Merge branch 'release' into dev 2016-04-22 14:09:01 -07:00
BrennanConroy 967001f923 Add publish-iis and fix web.config 2016-04-22 14:07:38 -07:00
Pavel Krymets 1f93977729 Migrate tests, tools and samples to portable 2016-04-19 10:43:11 -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 a60cce1dad Quick fix: Remove excess Microsoft.AspNetCore.Mvc.TagHelpers dependencies
- Microsoft.AspNetCore.Mvc brings this in
2016-04-16 18:43:28 -07:00
John Luo 059179b7b8 Add web.config to test sites 2016-04-13 16:12:56 -07:00
Ryan Nowak 3ec60a0181 Fix #4447 - Teach MVC to understand defaults
The wireup for defaults in attribute routes was missing
2016-04-11 14:38:29 -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
David Fowler 29646153ea Explicitly add tracesource dependency 2016-04-05 00:02:49 -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 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 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
John Luo 22b37fb83b Update samples and react to Kestrel extensions 2016-03-30 17:33:25 -07:00
Doug Bunting 6bf25cecec React to HttpAbstractions namespace changes
- aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592
- clean up `using`s
2016-03-30 16:19:42 -07:00
Kiran Challa e0212752e5 Removing AuthorizationFilterAttribute as we do not want users to easily create their own authorization implementation. They should instead
use authorization policies and requirements(IAuthorizationRequirement) to enforce authorization.
[Fixes #4233] AuthorizationFilterAttribute returns UnauthorizedResult rather than ChallengeResult
2016-03-30 15:34:41 -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
John Luo 555a8d0a3b Reacting to Hosting changes 2016-03-24 12:10:09 -07:00
Pranav K 06289945d0 Reacting to CoreCLR package changes 2016-03-22 14:49:43 -07:00
Pranav K fb07fee465 Reduce grunt work in Mvc 2016-03-17 15:25:33 -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
ryanbrandenburg 1ae1cdb10b * Remove ServiceProvider 2016-03-15 09:57:17 -07:00
ryanbrandenburg f1fa1bd8f4 * Remove JsonViewComponentResult 2016-03-11 11:40:54 -08:00
jacalvar 0489812aab React to changes in caching 2016-03-07 19:06:51 -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
N. Taylor Mullen 33d1aea8ea Transition to Netstandard.
- dotnet5.X => netstandard1.y (where y = x-1).
- DNXCore50 => netstandardapp1.5.
- Applied the same changes to ifdefs.
2016-03-01 13:39:31 -08:00
jacalvar 5423dc8c34 [Fixes #4099] Add a functional test for creating a form with a file upload field 2016-02-29 18:13:52 -08:00
Pranav K 80b6996701 * Moving DNX dependencies to test only
* Updating Mvc tests to use dotnet test to run on dnxcore50
2016-02-23 18:58:42 -08:00
Pranav K 5b805bb12d Updating to use cli
Fixes #3908
2016-02-22 17:49:51 -08:00
Kiran Challa fd3ee49987 [Fixes #4085] Controller helper inconsistency: HttpNotFound(), Ok() 2016-02-19 09:25:04 -08:00
Ajay Bhargav Baaskaran fd6d28d9eb Make AddControllersAsServices not overwrite existing IControllerTypeProvider 2016-02-17 10:14:31 -08:00
jacalvar 65858b8d8b [Fixes #4051] Split OutputFormatter into OutputFormatter and TextOutputFormatter 2016-02-12 12:04:18 -08:00
N. Taylor Mullen d20df7393d Fix project.json System.Runtime dependency. 2016-02-05 18:22:51 -08:00
N. Taylor Mullen f957c04c24 Update project.json to remove redundant System.Runtime dependency.
- This package is pulled in transitively.
2016-02-05 17:23:34 -08:00
jacalvar fe639f028f [Fixes 3961] Consider InputFormatter behavior when we can't read the charset
* Broken InputFormatter into InputFormatter and TextInputFormatter
* Added an exception to ModelState inside ReadAsync on TextInputFormatter
  when we can't find a valid encoding to read the body.
2016-02-05 10:42:36 -08:00
N. Taylor Mullen 59334dcf17 React to aspnet/Razor#604 2016-02-04 16:37:30 -08:00
N. Taylor Mullen 096007b394 Updated `Controller`s `ViewComponent` method to handle arguments.
- This bit was missed when changing the `ViewComponent` invocation pattern resulting in the inability to invoke `ViewComponent`s with arguments in a `Controller`.

#4004
2016-02-02 15:42:23 -08:00
Cesar Blum Silveira 50fc0bb140 Reference Microsoft.NETCore.Platforms where necessary. 2016-02-02 14:22:07 -08:00
ryanbrandenburg 2aca8810d3 * Give message correct path. 2016-02-02 11:08:41 -08:00
jacalvar 7cbb263edb [Fixes #3874] Null passed as arguments to controller method parameters when no InputFormatter matches
* Add an UnsupportedContentType to the ModelState dictionary when no formatter can read the body.
* Add a filter to the pipeline that searches for that specific exception and transforms the response into 415.
2016-01-28 15:46:17 -08:00
jacalvar 71a815be50 [Fixes #3979] AuthorizationContext conflicts with type in Microsoft.AspNet.Authorization 2016-01-26 16:27:40 -08:00
jacalvar 357f4a00b7 [Fixes #3952] ViewComponentDescriptor.Type should be a TypeInfo instance instead of a Type instance 2016-01-26 16:01:58 -08:00
N. Taylor Mullen 6a43c420b6 Remove unneeded project.json 2016-01-25 15:48:03 -08:00
N. Taylor Mullen 964e58723c Revert "Try out a Karma test or two"
This reverts commit d696f268f7.
2016-01-25 15:35:54 -08:00
Pranav K 6f885c7113 Adding empty project.json to unblock build 2016-01-25 12:11:50 -08:00
Doug Bunting d696f268f7 Try out a Karma test or two
- #1993
2016-01-25 10:50:32 -08:00
Ryan Nowak de3b33caf1 Internal cleanup in Razor 2016-01-24 21:50:33 -08:00
N. Taylor Mullen 25eb50120e Update ASP.NET 5 versions for ASP.NET Core.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:40:26 -08:00
N. Taylor Mullen 3be7fbdf9f Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:18:33 -08:00
N. Taylor Mullen 6a6c8ca544 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:17:07 -08:00
Brennan 8765a06b69 React to Fileprovider namespace changes 2016-01-21 17:45:06 -08:00
Ajay Bhargav Baaskaran a47a7fdccc Added caching for ActionConstraints 2016-01-21 17:30:08 -08:00
Ajay Bhargav Baaskaran f0777b95a8 [Fixes #3868] Exclude Antiforgery token in form with method Get 2016-01-21 11:29:41 -08:00
Ryan Nowak dd952d8d70 Move some types to .Internal namespace 2016-01-21 10:56:38 -08:00
Doug Bunting 2810858905 Add `HtmlEncoder` parameter to `RazorPage.StartTagHelperWritingScope()`
- aspnet/Razor#643 part 2: react to aspnet/Razor#653
 - change test calls and delegates to include new parameter
 - add tests specifically of the new feature
 - add tag helpers using new feature to `TagHelpersTest` functional test
- note `HtmlEncoder`s used elsewhere e.g. in other `RazorPage` instances are unaffected
 - i.e. changing one `RazorPage.HtmlEncoder` property only affects C# expressions in that page

Also simplify scope management, removing bizarre assertion when user does something odd.

nits:
- correct `// Act` and `//  Act & Assert` content
- remove #YOLO wrapping
2016-01-17 22:59:59 -08:00
John Luo 249673f2bc Reacting to hosting rename 2016-01-17 18:13:26 -08:00
javiercn 2063356f24 [Fixes #3683] Replace implementations in MediaTypeComparisons and
MediaTypeEncodings with memory efficient implementations using a MediaType
struct.
2016-01-12 15:09:48 -08:00
jacalvar 830fd410f5 Remove runtime dependency usage of MediaTypeHeaderValue.
Removes usage of MediaTypeHeaderValue in ApiExplorer, InputFormatters and
OutputFormatters

Public interface changes with stub implementation.
2016-01-12 15:09:46 -08:00
Pranav K 32d15186a0 Remove Razor precompilation 2016-01-12 14:51:33 -08:00
John Luo c8a59d7f3e Reacting to new middleware options pattern 2016-01-08 18:07:36 -08:00
Ajay Bhargav Baaskaran 0bb772a815 [Fixes #3755] Added logging for view compilation 2016-01-08 11:58:09 -08:00
Ryan Nowak 676bde29b9 Make Begin[Route]Form include antiforgery 2016-01-07 13:24:01 -08:00
Pranav K 2b9dd76535 Make RazorViewEngineOptions.FileProvider a list instead of a single item
Fixes #3806
2015-12-29 14:47:15 -08:00
John Luo b7d95d813d Reacting to middleware configureOptions updates 2015-12-23 12:27:57 -08:00
Pranav K 399e516065 Modify IViewComponentHelper to remove method selection ambiguity.
Fixes #612
2015-12-23 10:02:51 -08:00
Hao Kung 9364f896b3 Options renames for functionals 2015-12-21 16:18:22 -08:00
Kiran Challa d77655fb73 MVC Controller Response - Wrong ContentType #3245 2015-12-21 11:25:45 -08:00
N. Taylor Mullen 00722ce91a Remove `FilesWebSite` webroot. 2015-12-18 16:04:22 -08:00
Pranav K 7dac5c711b Reacting to Hosting changes 2015-12-18 15:59:42 -08:00
N. Taylor Mullen aa7ebb343a Update half of the test websites to use new Hosting API conventions.
https://github.com/aspnet/KestrelHttpServer/pull/496
2015-12-18 15:35:13 -08:00
ryanbrandenburg 70f9431e7f * Fix test failure 2015-12-16 17:21:25 -08:00
ryanbrandenburg 6a16681ed4 * Replace MvcMinimalSample with functional test 2015-12-16 15:18:25 -08:00
Ajay Bhargav Baaskaran 43eb621d19 [Fixes #2743] Removed ErrorReporterMiddleware in some places 2015-12-16 14:39:35 -08:00
Ajay Bhargav Baaskaran 232b27ad5d [Fixes #3430] Removed RouteKeyHandling.CatchAll 2015-12-16 11:57:22 -08:00
Doug Bunting 900663bfdd Make `project.json` formatting consistent 2015-12-14 21:51:04 -08:00
Doug Bunting 59824dc7be MVC functional test cleanup (part 1)
- #3612 subpart 2 of 2
- merge `ActionConstraintsWebSite`, `AntiforgeryTokenWebSite` and `ContentNegotiationWebSite` into `BasicWebSite`
  - remove tests depending on `ErrorReporterMiddleware` in merged sites; not used in `BasicWebSite`
- delete `CompositeViewEngineWebSite`, `Microsoft.AspNet.Mvc.ViewEngines.CompositeViewEngineTest` covers cases
- delete `CorsMiddlewareWebsite`, soon to be in Cors repo (see aspnet/CORS#57)
- remove `SendFileMiddleware` from FilesWebSite, unused there
2015-12-14 21:50:55 -08:00
Doug Bunting 8a310b35a4 Update to latest `UseRequestLocalization()` signature
- build break

nit: add more trailing commas in init syntax
2015-12-11 22:58:13 -08:00
Pranav K 56c6975a21 Tweak CacheTagHelper sample to use a token provider service for
cache expiration.

Fixes #3573
2015-12-11 15:23:34 -08:00
Doug Bunting 19e6fb5719 MVC functional test cleanup part 1
- #3612 (subpart 1 of 2)
- delete six sites and associated tests entirely
  - `ActionResultsWebSite`
  - `ActivatorWebSite`
  - `ControllerDiscoveryConventionsWebSite`
  - `LoggingWebSite`
  - `LowercaseUrlsWebSite`
  - `ModelBindingWebSite`, now covered in integration tests
  - remove now-unused `FilteredDefaultAssemblyProviderFixture`, `LoggingAssert` and `LoggingExtensions`
- move six test web sites into `./samples`
  - `CustomRouteWebSite` -> `CustomRouteSample.Web`
  - `FormatFilterWebSite` -> `FormatFilterSample.Web`
  - `InlineConstraintsWebSite` -> `InlineConstraintSample.Web` (now singular)
  - `JsonPatchWebSite` -> `JsonPatchSample.Web`
  - `LocalizationWebSite` -> `LocalizationSample.Web`
  - `RazorEmbeddedViewsWebSite` -> `EmbeddedViewSample.Web` (no longer "Razor" and now singular)
  - do some cleanup: remove test dependencies, shorten sample controller names, use more attribute routing
- correct "license" spelling in `ApplicationModelWebSite`
2015-12-11 13:13:41 -08:00
ryanbrandenburg 3393ba43c2 * Parameters into the messages 2015-12-11 12:05:44 -08:00
Kiran Challa a208c95a4f Deleted stale files from earlier deleted test website UrlHelperWebSite 2015-12-11 11:12:52 -08:00
Ryan Nowak ed93a6c812 React to routing breaking changes 2015-12-11 09:30:51 -08:00
Kiran Challa 57b88baad0 [Fixes #3624] MVC functional test cleanup (part 2) 2015-12-10 16:26:39 -08:00
Ryan Nowak 96de1dbe4b Remove IExcludeTypeFilter
- Removes IExcludeTypeFilter
- Replaced with a property 'ValidateChildren' on ModelMetadata
- Teach ValidationVisitor to respect 'ValidateChildren' for enumerable
  types.
2015-12-09 12:30:13 -08:00
Ryan Nowak 09a293afe9 React to routing cleanup 2015-12-07 13:08:13 -08:00
David Fowler 99f501152b Remove dependency on ICompilationOptionsProvider
- Removed Configuration from RazorViewEngineOptions
- Added ParseOptions and CompilationOptions to RazorViewEngineOptions
2015-12-07 12:29:52 -08:00