Commit Graph

1684 Commits

Author SHA1 Message Date
mnltejaswini 007c47d065 [Perf] Optimize controller action invoke
Fixes aspnet/MVC#3903
2016-03-14 10:17:55 -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
Brice Lambson 7b70da14bc Don't reference facades in NuSpec
These can be removed entirely after dotnet/cli#164
2016-03-10 14:07:45 -08:00
jacalvar 75df24e357 Added tests for HttpOptionsAttribute 2016-03-10 09:49:44 -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
Pranav K 6d3bd33c64 Revive DefaultRoslynCompilationServiceTest
Partially fixes #4140
2016-03-09 11:50:14 -08:00
Pranav K 501547d630 Remove IMvcRazorHost.MainClassPrefix 2016-03-09 11:50:07 -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
jacalvar 0489812aab React to changes in caching 2016-03-07 19:06:51 -08:00
Pranav K 5a7267a83d Revive DefaultAssemblyProviderTests
Partial fix for https://github.com/aspnet/Mvc/issues/4140
2016-03-07 17:01:58 -08:00
mnltejaswini d537ec06cc [Perf] Using single UrlHelper per HttpContext and one StringBuilder per UrlHelper to reduce allocations 2016-03-07 13:48:54 -08:00
Ajay Bhargav Baaskaran e39cbf077c React to aspnet/Session#96 changes 2016-03-04 17:18:34 -08:00
Pranav K 7bd7b32fcb Reacting to Localization CookieName change 2016-03-04 10:33:50 -08:00
Pranav K 3aa3799494 Rename ICanHasViewContext to IViewContextAware
Fixes #4073
2016-03-04 10:33:49 -08:00
Ryan Nowak 0b7035ddcf Implement MoveTo semantics in Mvc
- Simplify things that used to rely on HtmlTextWriter. This behavior is
  now the default.

- Simplify a whole mess of Razor TextWriter code.

- Integration test for merging of TagHelper buffers back into the 'main'
  buffer.
2016-03-04 07:54:31 -08:00
Doug Bunting d3c24637b1 Correct `Type.IsAssignableFrom()` polarity
- #3482
 - see new tests; many failed without fixes in the product code
 - add support for binding `IFormFileCollection` properties
 - make `FormFileModelBinder` / `HeaderModelBinder` collection handling consistent w/ `GenericModelBinder`++
  - see also dupe bug #4129 which describes some of the prior inconsistencies
  - add checks around creating collections and leaving non-top-level collections `null` (not empty)
 - move smarts down to `ModelBindingHelper.GetCompatibleCollection<T>()` (was `ConvertValuesToCollectionType<T>()`)
  - add `ModelBindingHelper.CanGetCompatibleCollection()`
  - add fallback for cases like `public IEnumerable<T> Property { get; set; } = new T[0];`
- #4193
 - allow `Exception`s while activating collections to propagate
- part of #4181
 - `CollectionModelBinder` no longer creates an instance to check if it can create an instance
 - not a complete fix since it still creates unnecessary intermediate lists

nits:
- correct a few existing test names since nothing is not the same as `ModelBindingResult.Failed()`
- remove a couple of unnecessary `return` statements
- correct stale "optimized" comments
- explicit `(string)`
2016-03-03 09:55:01 -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
Kiran Challa b7cde3e58f [Fixes #4043] Figure out ControllerModel.AttributeRoutes 2016-03-01 10:28:24 -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
Shahriar Gholami 1e5b0b9bec Allow to define section or/and body without the need to render it 2016-02-26 18:02:19 -08:00
Doug Bunting 49ffeb16d2 Test fix: Change `CollectionModelBinderTest` to update `ModelMetadata.IsReadOnly`
- unrelated to #3482 except that I discovered the issue while investigating that issue
- tests previously set `BindingDetails.IsReadOnly` for a `Type` and that was ignored
 - same for `DictionaryModelBinderTest`
2016-02-26 15:58:09 -08:00
Pranav K 385c21fbe2 Add Microsoft.AspNetCore.Mvc.Dnx to allow using Mvc with DNX 2016-02-26 15:14:32 -08:00
ryanbrandenburg 00bab92257 * Linux FS is case sensitive 2016-02-26 11:59:23 -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
Sebastien Ros c259f82615 [Fixes #4112 #4093] Adding support for custom SSL port
New optional MvcOptions.SslPort. If not defined the redirection uses an empty port (default),
otherwise the custom port is used.
2016-02-23 10:21:11 -08:00
Pranav K 5b805bb12d Updating to use cli
Fixes #3908
2016-02-22 17:49:51 -08:00
Kiran Challa 779edb6fe1 React to Routing service collection extension changes 2016-02-22 11:43:08 -08:00
Ajay Bhargav Baaskaran df5eb0a15c [Fixes #4092] Using System.Buffers in JsonResultExecutor 2016-02-19 16:45:26 -08:00
Kiran Challa 4123d83d26 [Fixes #4047] SelectTagHelpers: asp-items shouldn't require/depend on asp-for. 2016-02-19 10:03:45 -08:00
Kiran Challa fd3ee49987 [Fixes #4085] Controller helper inconsistency: HttpNotFound(), Ok() 2016-02-19 09:25:04 -08:00
Ryan Nowak b557ca55d9 Fix behavior of StartsWithPrefix
This undoes a behavior change introduced in
7b18d1d3f1.

The intent was to have ClearValidationState do the right thing for a case
where a collection was bound to the empty prefix, and then used again with
TryUpdateModel.

This change was implemented by saying that a key like "[0].Foo" is a match
for the prefix of "Foo". This isn't really right, and it's only
interesting for the ClearValidationState case.

The problem is that we don't know what the keys look like for a
collection. We can assume that they start with [0] but that's not really a
guarantee, it's a guess.

This change fixes the behavior of StartsWithModel, and move the
responsibility for this case back into ClearValidationState.

This change also removes the call to ClearValidationState from
TryUpdateModel. If you need this behavior, then call ClearValidationState
manually. Trying to bind and then re-bind a model object isn't really what
we intend.
2016-02-17 11:16:16 -08:00
Ajay Bhargav Baaskaran fd6d28d9eb Make AddControllersAsServices not overwrite existing IControllerTypeProvider 2016-02-17 10:14:31 -08:00
jacalvar 910f0139f9 [Fixes #4050] Throw an exception on CanRead/Write and GetSupportedContentTypes when the list of media types is empty 2016-02-16 17:16:16 -08:00
Kiran Challa 7337f50112 [Fixes #3774] DataAnnotation validation ignored 2016-02-16 08:52:50 -08:00
jacalvar ac23e5aec6 [Fixes #4013] Added support for areas in 'a' and 'form' tag helpers 2016-02-12 17:08:17 -08:00
jacalvar 65858b8d8b [Fixes #4051] Split OutputFormatter into OutputFormatter and TextOutputFormatter 2016-02-12 12:04:18 -08:00
N. Taylor Mullen dca15c0a60 React to https://github.com/aspnet/Razor/pull/683 2016-02-10 16:53:33 -08:00
Ryan Nowak 698502df8c Rewrite MutableObjectModelBinder
A rewrite focused on simplifying extensibility points and reducing
allocations.
2016-02-10 09:48:05 -08:00
Chris R fa9f13db2d React to MediaTypeHeaderValue.Parse exception message change. 2016-02-08 22:26:55 -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
Ajay Bhargav Baaskaran 8e8de413f8 Re-enable few tests on Mono 2016-02-04 16:53:09 -08:00
N. Taylor Mullen 59334dcf17 React to aspnet/Razor#604 2016-02-04 16:37:30 -08:00
Ryan Nowak 9ea5a939cf Move Antiforgery.GetHtml() to MVC as an extension 2016-02-04 13:08:38 -08:00
Ryan Nowak 063bc1f8e8 Replace comparer with a bespoke BinarySearch 2016-02-04 11:25:34 -08:00