Commit Graph

36 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
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
Ajay Bhargav Baaskaran e39cbf077c React to aspnet/Session#96 changes 2016-03-04 17:18:34 -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
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
Ryan Nowak 9ea5a939cf Move Antiforgery.GetHtml() to MVC as an extension 2016-02-04 13:08:38 -08:00
N. Taylor Mullen acd88d08ba Enable invoking a `ViewComponent` without arguments inside of a controller.
- Also updated doc comments to properly reflect `ViewComponent` `arguments` parameter.
2016-02-03 10:30:02 -08:00
Kiran Challa bf93c7d7a4 Removed JavaScriptEncoder property from HtmlHelper 2016-02-02 16:52:13 -08:00
N. Taylor Mullen d97fe04cd7 Fix Mvc tests. 2016-02-02 16:03:08 -08:00
Cesar Blum Silveira 50fc0bb140 Reference Microsoft.NETCore.Platforms where necessary. 2016-02-02 14:22:07 -08:00
Doug Bunting 8189d852d1 Remove OSx+Mono skips related to aspnet/External#50
- CoreFx worked around the underlying issue
- add `PlatformNormalizer.NormalizeContent()` call in previously-disabled test
2016-01-30 22:51:48 -08:00
Doug Bunting 0ca3fde526 Fix line endings in HTML helper tests for x-plat 2016-01-29 23:57:45 -08:00
Doug Bunting 26a14a25ab Support overrides for client-side validation messages
- #2969
- `RemoteAttribute` did not support `IStringLocalizer` overrides
 - use same `MvcDataAnnotationsLocalizationOptions` property as for other `ValidationAttribute`s
- error message `NumericClientModelValidator` added could not be overridden
 - not related to `IStringLocalizer` because users have no way to set the resource lookup key
 - extend `IModelBindingMessageProvider` to add the necessary `Func<,>`
- also correct problem using resources with `RemoteAttribute` and add lots of tests
2016-01-29 11:23:57 -08:00
Ajay Bhargav Baaskaran 47351aac7a Added caching for client model validators 2016-01-29 10:40:41 -08:00
Derek Gray 8b726ddc0c Allow the use of the Prompt property of DisplayAttribute for the placeholder attribute of input fields (addresses #3723) 2016-01-27 16:18:23 -08:00
ryanbrandenburg 78e7179221 * Remove HttpRespomseStreamWriter 2016-01-27 16:04:54 -08:00
Ryan Nowak 1a70f12bf8 Undesign client validation
This change removes a layer of abstraction. These validators now just do
what they do now without creating a bunch of intermediate objects.

ModelClientValidationRule has been removed, and client validations
manipulate the attributes collection of a tag directly.
2016-01-27 09:55:18 -08:00
Ajay Bhargav Baaskaran 8c4bcf14c7 Added caching for validators 2016-01-26 17:15:16 -08:00
jacalvar 71a815be50 [Fixes #3979] AuthorizationContext conflicts with type in Microsoft.AspNet.Authorization 2016-01-26 16:27:40 -08:00
Ajay Bhargav Baaskaran 726ebb7a05 Updated unit test coverage for html helpers
- updated HtmlHelperLabelExtensionsTest
 - Added tests for HtmlHelperInputExtensions
 - Added tests for ValidationMessage and ValidationSummary extensions
2016-01-26 16:04:35 -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
jacalvar 354400f12b [Fixes #3752] Refactor and cleanup view components
* Moved instantiation of view components into DefaultViewComponentActivator
* Introduced IViewComponentFactory to handling setup of new view component instances.
* Added a release method on IViewComponentActivator for handling tear down of view
  component instances.
2016-01-26 14:18:12 -08:00
Doug Bunting 7dddd06a38 Add more tests of `TagBuilder.CreateSanitizedId()`
- investigating #3951
2016-01-25 21:58:39 -08:00
Ryan Nowak 434da683fc Improve buffering of Razor output in MVC
These changes are aimed at significantly improving the performance of
MVC/Razor when a large amount of content is in play or a large number of
TagHelpers are used.

A few issues addressed:

- Buffer sync writes after a flush has occurred so that we can write them
  asyncronously. The issue is that an IHtmlContent can only do sync
  writes. This is very bad for Kestrel in general. Doing these writes
  async is better for our overall perf, and the buffer that we use for it
  is from the pool.

- 'Flatten' ViewBuffers when possible. A page with lots of TagHelpers can
  end up renting a ViewBuffer and only write 2-3 things into it. When a
  ViewBuffer sees another ViewBuffer we can either steal its pages, or
  copy data out and 'return' its pages. This lets us use 3-4 buffers for a
  large Razor page instead of hundreds.
2016-01-25 12:40:52 -08:00
Ryan Nowak 8b1bd343ba Internal cleanup in ViewFeatures 2016-01-24 22:13:29 -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