Commit Graph

2007 Commits

Author SHA1 Message Date
Ryan Nowak 229724c4ea Reorganize MVC namespaces 2015-09-01 22:28:33 -07:00
Daniel Lo Nigro a2e53e8d1a Explicitly check if URI is file when checking for an absolute URI 2015-09-01 16:33:00 -07:00
Ben Adams 55fc7ded36 Don't invoke async state machine unnecessarily
Return task rather than awaiting when no extra work needs to be done
after await
2015-08-31 17:48:57 -07:00
Ryan Nowak 98b3f055e1 Change ModelBinding to use a single pass 2015-08-31 11:58:53 -07:00
Pranav K 8a33972c09 RazorViewEngine should cache transformed paths when view cannot be found
Fixes #3034
2015-08-31 10:36:57 -07:00
Kiran Challa e12d44b40a [Fixes #2900] Get rid of manual body-read-state-tracking 2015-08-31 10:34:42 -07:00
Chris R dd737ce946 Use new HttpContext.Features API. 2015-08-31 09:19:14 -07:00
Ryan Nowak 66a7c2e389 Revert "Enabling ViewEngine and Localization tests which use expanders. The issues are fixed in the mono beta 4.0.4."
This reverts commit 9915ea3809.
2015-08-31 08:55:31 -07:00
Ryan Nowak dadee80aa8 Add FieldName to model binding context
Adds a new property, FieldName, to ModelBindingContext. The FieldName is
the name of whatever code-element is being bound, regardless of what
model-prefix is in use.

This is needed for cases like the Header model binder. We always want to
use the property/parameter name and we don't care about model prefixes.
2015-08-31 08:10:03 -07:00
Chris R e0e2ff6825 Fix doc comment error. 2015-08-30 19:43:51 -07:00
sornaks 9915ea3809 Enabling ViewEngine and Localization tests which use expanders. The issues are fixed in the mono beta 4.0.4. 2015-08-29 16:55:14 -07:00
Chris R f2db0d1483 React to string[] -> StringValues changes. 2015-08-28 16:36:19 -07:00
Pranav K a2d58ba4ea Reacting to globbing changes 2015-08-28 12:50:29 -07:00
Sornakumar Sundararajan e8043f92e5 Issue #2757 - Adding Order to exception filters so that they are executed in the same order irrespective of the platform. 2015-08-28 11:22:11 -07:00
Ajay Bhargav Baaskaran 4fbaea2463 [Fixes #2931] AttributeRoute does not replace existing route values with null 2015-08-28 11:11:03 -07:00
Pranav K c0d4981452 * Avoid lazyily evaluating IRazorCompilationService in
VirtualPathRazorPageFactory
* Cleanup comments on the lifetime of Razor services.
2015-08-27 17:08:18 -07:00
sornaks ddc74e5396 Issue #2727 - Introducing PhysicalFilePathResult and VirtualFilePathResult instead of FilePathResult to handle app and physical file system paths separately. 2015-08-27 10:23:23 -07:00
Ryan Nowak d74e81186b Use a copy on write list for items in Resource Filters
We allocate a separate list for model-binding related objects when we
create the resource filter contexts, and these lists then live the
lifetime of the request. These *may* be modified by user code in
filters as a supported feature, but rarely are changed in practice.

This change adds a simple CopyOnWriteList implementation to reduce the
amount of copying that's actually done.
2015-08-26 13:29:38 -07:00
N. Taylor Mullen 581d738732 Try beta 2015-08-26 12:52:30 -07:00
N. Taylor Mullen 0d9d01381c Test 2015-08-26 12:51:19 -07:00
N. Taylor Mullen 53b72f65f4 Force mono to specific version.
- Mono just pushed a change to their alpha feed that looks to have broken several MVC tests. As an interim fix specifying the version will ensure MVC builds on travis.
2015-08-26 12:48:35 -07:00
Pranav K 6615972162 Adding System.Text.Encoding to project.json to unblock CI 2015-08-26 10:11:27 -07:00
N. Taylor Mullen cc5c0d6cbe Update `HelperResult` to take in an async func.
- The corresponding Razor change results in `HelperResult`s being rendered with async lambdas.
- This change enables `TagHelper`s and other async code to exist inside of `HelperResult` blocks.
- Added test to validate Templates (they generate `HelperResult`s) can utilize `TagHelper`s correctly.
- Rename `RazorPage`s `RenderBodyDelegate` to `RenderBodyDelegateAsync`.

aspnet/Razor#494
2015-08-25 22:37:17 -07:00
Pranav K 3041dee86d Modify RazorPreCompileModule to use an instance of memory cache specific
to the application's target framework and configuration.
2015-08-25 22:26:16 -07:00
Pranav K 44b45f3b1f Move RazorPreCompileModule.cs to Razor.Precompilation 2015-08-25 14:33:13 -07:00
Pranav K 1bad8ce6d1 Ensure that assembly path is specified in Roslyn MetadataReference. 2015-08-25 12:56:23 -07:00
Doug Bunting 829a5c9046 Expand model types `GenericModelBinder` can handle
- #2993
- use `ClosedGenericMatcher` to handle e.g. non-generic model types implementing requested interfaces
- reduce `IsAssignableFrom()` use since created binders use explicit casts i.e. handle explicit implementations
- also add more integration tests covering various collection key formats, some with validation errors
  - merge a few `[Fact]`s into `[Theory]`s
2015-08-25 09:50:31 -07:00
Ryan Nowak cfd9bfe13b [PERF] Remove extra ModelStateDictionary allocations
The copy constructor is chaining to the wrong constructor. This results in
an extra 8 allocations of ModelStateDictionary per-request. All of the
various filter contexts inherit from ActionContext, that's how you get the
8 extras.

Small problem but easy fix.
2015-08-24 15:26:09 -07:00
KevinDockx 054b46c1cc Implement new Remove op & fix value.GetTypê issue in Add op 2015-08-24 12:32:41 -07:00
Doug Bunting bf7e0f141e Add `IsReferenceOrNullableType` and `UnderlyingOrModelType` to `ModelMetadata`
- #2992
- use new properties to replace common helper methods
- still a few `Nullable.GetUnderlyingType()` calls
  - creating `ModelMetadata` or sites lacking `ModelMetadata` access e.g. `ModelBindingHelper.ConvertTo()`
2015-08-24 12:26:50 -07:00
Ajay Bhargav Baaskaran 0beb39ec1c [Fixes #2947] Default ContentType is not set when user specified Response.ContentType exists 2015-08-24 12:17:18 -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
Doug Bunting a045324d3a Do not include compiler-generated names in expression names
- #2890
- add lots of `ExpressionHelper` tests using `IdFor()` and `NameFor()` (which are thin veneers)
2015-08-23 14:22:49 -07:00
Doug Bunting 8babf2b380 Change in-box tag helpers to use `DefaultFrameworkSortOrder`
- #2905
- override `Order` implementation inherited from `TagHelper`
- only exception is `UrlResolutionTagHelper` which already overrides `Order` to execute much earlier
2015-08-22 15:32:02 -07:00
Ryan Nowak 4a7ada5f64 Make IValueProvider sync, IValueProviderFactory async 2015-08-21 14:58:55 -07:00
Ajay Bhargav Baaskaran 3519c375fc Minor cleanup - removed unwanted @ 2015-08-21 14:40:35 -07:00
Doug Bunting aaa47d5e0e Workaround https://github.com/aspnet/External/issues/21 in a couple more tests
- led to Travis build failures
2015-08-21 14:12:15 -07:00
Ajay Bhargav Baaskaran 774219b2ef [Fixes #2788] Added a sample taghelper that handles IE conditional comments 2015-08-21 11:19:49 -07:00
Ryan Nowak 6d365e9a32 Make ValueProviderResult a string-ish struct 2015-08-21 11:02:40 -07:00
Doug Bunting 02cc82a055 PR comments commit 2015-08-21 10:45:43 -07:00
Doug Bunting 070be7b656 Make validation in `TryUpdateModelAsync()` consistent with model binding elsewhere
- #2941
- honor `ModelBindingResult.IsModelSet` and use `ModelBindingResult.ValidationNode`
  - enable correct validation of collections or after model binding falls back to the empty prefix
  - code previously matched `Controller.TryValidateModel()`; less context available in that case
2015-08-21 08:17:19 -07:00
Ryan Nowak b5c9d905d9 Fix #2986 - Make ModelMetadata getters null-safe 2015-08-21 07:58:02 -07:00
N. Taylor Mullen 8b5bb0133d Update 'build.sh' to pull Sake from v2 NuGet feed. 2015-08-20 20:47:50 -07:00
N. Taylor Mullen c3e2e6fa0a Change Script, Link and Image `TagHelper`s to work better with other `TagHelper`s.
- `ScriptTagHelper`, `LinkTagHelper` and `ImageTagHelper` now default to using `output.Attributes["href|src"]` if it's present when they run. This enables other `TagHelper`s to run prior and add those attributes.
- Added unit tests to validate this behavior.
- Updated `ImageTagHelper` functional test resources. Now that we're always defaulting to `output.Attributes["src"]` for `ImageTagHelper.Src` we're properly copying attributes back into the `output.Attributes` collection in the correct order (isntead of appending to the end).

#2902
2015-08-20 20:41:28 -07:00
Ryan Nowak 052479af6b Revert "Swap back to nuget.org v2 feed"
This reverts commit a17da51256.
2015-08-20 19:55:08 -07:00
N. Taylor Mullen c666c9edb6 Update 'build.cmd' to pull Sake from v2 NuGet feed. 2015-08-20 15:38:45 -07:00
Ryan Nowak a17da51256 Swap back to nuget.org v2 feed
This is causing Travis.ci to fail. We'll stage a move to the v3 feed later
on.
2015-08-20 14:42:45 -07:00
Pranav K 05226a4a55 Refactor ICompilerCache to be instantiated via ICompilerCacheProvider
Fixes #2933
2015-08-20 10:54:32 -07:00
Ryan Nowak e61ebca116 Fix #2996 - Make InnerAttribute logs Verbose 2015-08-19 15:33:14 -07:00
N. Taylor Mullen f1eefdb650 Enable `CopyHtmlAttribute` to maintain copied attribute order.
- Updated implementation to do a best guess at copying an attribute back into `TagHelperOutput.Attributes`.
- Updated existing functional and unit tests to account for maintained attribute order.
- Added a set of complex order based unit tests to validate `CopyHtmlAttribute` properly maintains order.

#2639
2015-08-19 14:58:00 -07:00