Commit Graph

2357 Commits

Author SHA1 Message Date
Pranav K 3a7c9c73ed Enabling CoreCLR tests on Travis 2015-12-09 15:20:15 -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
Sebastien Ros 774ee05508 Clean up ViewStartPages usage in RazorView
Fixes #3682
2015-12-09 10:55:59 -08:00
Ryan Nowak cf6662d0c3 Partial fix for #3676 - fix race in ElementMetadata
The accessor for ElementMetadata can sometimes return null when
concurrently accessed.

This change solves this issue and simplified a bunch of lazy-computed
properties, by precomputing all type-related facets of ModelMetadata.

This also adds a ElementType property to ModelMetadata to maintain
the current separation of concerns as ModelMetadata is unaware of the
metadata provider.
2015-12-09 08:21:18 -08:00
Pranav K c6f8ced9a2 Fixing CoreCLR package versions 2015-12-08 16:40:03 -08:00
Pranav K 8c4b5c6c9a Fixing build break 2015-12-08 15:57:19 -08:00
Pranav K be46c7602e Add IAssemblyLoadContextAccessor to the service collection 2015-12-08 15:42:09 -08:00
Pranav K 218613bc0a Reacting to Diagnostics changes 2015-12-08 15:10:59 -08:00
David Fowler 6467d0d475 Add ILibraryManager explicitly 2015-12-07 18:00:03 -08:00
Kiran Challa ceaa9a9251 Add test coverage for Flags enum binding 2015-12-07 17:18:06 -08:00
John Luo f9f59fe58b Reacting to verbose rename 2015-12-07 14:50:54 -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
David Fowler 80e25344f6 Merge pull request #3690 from khellang/form-file-changes
React to changes to FormFile
2015-12-04 12:05:10 -08:00
Kristian Hellang e1bfc6b48e React to changes to FormFile 2015-12-04 20:40:39 +01:00
Ryan Nowak aa48f79816 Use Routing.Abstractions 2015-12-03 18:07:14 -08:00
Pranav K ff34c5404a Implement a backing-buffer for Razor using pooled memory
Fixes #3532
2015-12-03 17:42:20 -08:00
Doug Bunting 1f76b3c7b7 Clean up remaining `HtmlString` usage
- #3122 and #3123 (5 of 5)
- avoid concatenating values and wrapping them in an `HtmlString`
  - switch from `string.Format()` to `AppendHtml()` in `LinkTagHelper`
  - simplify `RazorPage` and `TagHelperContentExtensions` e.g. don't use a `TagHelperContentWrapperTextWriter`
  - add some special cases in `UrlResolutionTagHelper`
- add `TagBuilder` and `StringHtmlContent` special cases to avoid `StringWriter` use when value is an `HtmlString`
- move `HtmlTextWriter` optimizations a bit lower and add missing checks for that type

nits:
- correct comments that incorrectly mention `HtmlString`s
- update comments in `JavaScriptStringArrayEncoder`
2015-12-03 15:37:44 -08:00
Kiran Challa dd774366f6 Addressed feedback 2015-12-03 14:42:14 -08:00
Kiran Challa 6712f9d9ff Deleted ValueProvidersWebSite and tests 2015-12-03 14:42:13 -08:00
Kiran Challa 9539c373ba Deleted ViewComponentWebSite and tests 2015-12-03 14:42:12 -08:00
Kiran Challa 9288ab1a34 Removed TempDataWebsite and merged to BasicWebsite and fixed tests 2015-12-03 14:42:11 -08:00
Kiran Challa 3c694ce77c Movig RequestServicesWebsite to BasicWebsite 2015-12-03 14:42:10 -08:00
Pavel Krymets 362c81e9bb React to abstraction changes 2015-12-03 14:26:43 -08:00
Pavel Krymets 046dcefd14 Add extensibility point to Razor compilation 2015-12-03 12:04:07 -08:00
Eilon Lipton 236ba40d00 Add link to community project 2015-12-02 21:15:26 -08:00
Doug Bunting 42f3e764b0 Move logic from `HtmlLocalizer` to `LocalizedHtmlString`
- part of #3123 (4 of 5)
- `LocalizedHtmlString` should not subclass `HtmlString`; now implements `IHtmlContent`

nits:
- clean up a few doc comments
- remove duplicate tests reported while testing these fixes in VS
2015-12-02 18:39:37 -08:00
Ryan Nowak 9fc3a80056 Remove IActionContextAccessor from UrlHelper
This change removes the IActionContextAccessor as a dependency of
UrlHelper, and shifts UrlHelper to use a factory pattern. Consumers of
IUrlHelper should create an instance using the factory when needed.

This is the last part of MVC that has a dependency on IActionContext
accessor. As part of this change we no longer register it by default, and
treat it as an optional component.
2015-12-02 17:09:43 -08:00
Brennan 3062eea7d0 Dispose FileWatcher, MvcRazorHost, and ChunkTree 2015-12-02 13:07:45 -08:00
Pranav K a424e3e278 React to namespace rename part 3 2015-12-02 11:56:38 -08:00
Pranav K 6ab9acc3f6 React to Microsoft.AspNet.Html namespace rename part 2 2015-12-02 11:32:21 -08:00
Pranav K 7e2eb16960 React to Microsoft.AspNet.Html namespace rename 2015-12-02 11:15:54 -08:00
Ryan Nowak 07085ca69b Remove IHttpContextAccessor from TempData
This change removes the dependency of TempData on the IHttpContextAccessor
by creating an ITempDataDictionaryFactory abstraction. In general, no one
will replace the factory, it's just indirection.

This allows us to drop our dependency on IHttpContextAccessor, and move it
to the functional tests where we specifically depend on it.

The bulk of code churn here is to update tests that use TempData.
2015-12-02 08:18:57 -08:00
Pranav K 70bdb6eb3e Removing CopyTo from RazorTextWriter 2015-12-01 12:37:11 -08:00
apxoht 7e1a6222aa Removed unused private method in DefaultActionSelector 2015-11-30 17:14:28 -08:00
Jeffiy 8428ec46e1 Remove extra null checks.
Fixes #3657
2015-11-30 16:53:10 -08:00
Ryan Nowak 6875ee55d3 Remove Magic Link Generation
This change resolves #3512 and #3636 by removing 'magic' link generation
and adding an extension method to add routes to areas correctly using the new
pattern. This is pretty much exactly the same as how MapWebApiRoute works.

For site authors, we recommend adding area-specific routes in a way that
includes a default AND constraint for the area. Put your most specific
(for link generation) routes FIRST.

Ex:

  routes.MapRoute(
      "Admin/{controller}/{action}/{id?}",
      defaults: new { area = "Admin" },
      constraints: new { area = "Admin" });

The bulk of the changes here are to tests that unwittingly relied on the
old behavior.
2015-11-30 11:24:23 -08:00
ryanbrandenburg 91e837d465 * Debug log exceptions in JsonInput deserializing 2015-11-30 11:19:22 -08:00
ryanbrandenburg d22d6793ba * Include DisplayName in errorMessage 2015-11-30 11:18:14 -08:00
Pranav K c5346f7bf9 Use string.IsNullOrEmpty instead of string.IsNullOrWhitespace
Fixes #3593
2015-11-30 10:00:44 -08:00
N. Taylor Mullen 490fcf1ab4 Remove the use of `Linq` and unneeded enumerators from Mvc `TagHelper`s.
- Prior to this change we were using `Linq` throughout our `TagHelper`s which resulted excess allocations.
- Also went through our data structures and changed some from `Enumerable<T>` to `IList<T>` where we were just not exposing the more accessible types (list).
- Changed several locations of `foreach` to `for` to remove the enumerator allocation.

#3599
2015-11-25 21:31:24 -08:00
Ryan Nowak a14fdd8637 Remove FormatFilter dependency on IActionContextAccessor
This change simplifies IFormatFilter's API and removes the dependency on
IActionContext accessor.

The old API for IFormatFilter required computing state based on the
current request as part of the constructor, which in turn implied the use
of a context accessor. This isn't really needed. I didn't preserve caching of
the 'format' as that seems like an early optimization.
2015-11-25 17:01:16 -08:00
Ryan Nowak d8cc2b85d5 Adds ActionContext to Validation contexts
This change makes it possible to access the ActionContext/ActionDescriptor
from inside of validators and client validators.
2015-11-25 16:38:26 -08:00
Pranav K 017bf1a20f Changes to use moq-netcore 2015-11-25 16:04:04 -08:00
Ryan Nowak 0832365ec2 Adds ActionContext to OperationBindingContext
This change makes it possible to access the ActionContext/ActionDescriptor
from inside of modelbinding.
2015-11-25 15:17:09 -08:00
Kiran Challa 31e42ee312 [Fixes #3433] Invalid media type 'text/plain; charset=utf-8' 2015-11-25 10:50:40 -08:00
Ryan Nowak 4bcf236450 MVC companion to aspnet/Routing#238
This is a companion change to make the RouteValueDictionary type more
promient. Using the concrete type here allows to avoid allocations in a
lot of common scenarios.
2015-11-25 10:36:50 -08:00
Doug Bunting 6e299d695f Update `DefaultHtmlGenerator.GenerateAntiforgery()` to match latest `IAntiforgery.GetHtml()`
- #3123 (3 of 5 or so)
- react to rest of aspnet/Antiforgery@6a9b38d
  - remove `HtmlEncoder` from localization requirements
  - literal `hidden` is no longer HTML encoded (was a no-op anyhow)
2015-11-25 09:49:15 -08:00
Doug Bunting 7bb0a1a4fe Update `IJsonHelper` to use `IHtmlContent`
- part of #3123 (2 of 5 or so)
- do not expose specific `HtmlString` class
2015-11-25 09:49:05 -08:00
Doug Bunting d84587a99d Quiet `initialization` target in `MvcSandbox` folder 2015-11-25 09:48:54 -08:00