- #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
- Removes IExcludeTypeFilter
- Replaced with a property 'ValidateChildren' on ModelMetadata
- Teach ValidationVisitor to respect 'ValidateChildren' for enumerable
types.
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.
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.
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.
- #3571 and part of #3123
- split `ContentViewComponentResult` in two
- add `HtmlEncoder` to `ViewComponentContext`
- remove use of `WebUtility.HtmlEncode()` and `HtmlDecode()`
nits: remove unused `using`s in files I had open
This change introduces ControllerContext for inside of Controllers, and
controller-specific extensibility points. ControllerContext carries with
it the model binding infrastructure needed to do all of the things that
controllers need to do.
- `true` has the opposite meaning now but most changes are due to new parameters names in `IViewEngine`
- use name names in `Microsoft.AspNet.Mvc.ViewFound` and not found events
- remove `IRazorPage.IsPartial` and `RazorView.IsPartial`
- remove `IsPartial` properties from `Microsoft.AspNet.Mvc.Razor.BeginInstrumentationContext` and end events
- add parameter checks to `RazorView` constructor; instances are not retrieved from DI
nits:
- remove unused `cacheKey` parameter from `RazorViewEngine.CreateCacheResult()`
- correct duplicate test names in `RazorPageTest`
- also `...OnPageExecutionListenerContext` -> `...OnPageExecutionContext`
- #3307
- relative paths are now supported in `View()` calls from components and view components,
`Html.PartialAsync()` and similar calls, and `RazorPage.Layout` settings.
- support absolute paths, relative paths, and view location lookups consistently / everywhere
- support view paths in `TemplateRenderer` e.g. passing an absolute path to `Html.EditorFor()`
- take a big swing at the `IRazorViewEngine` and `IViewEngine` interfaces
- split lookups (view names) from navigation (view paths)
- remove `Partial` separation; use parameters to set `IsPartial` properties
- correct `ViewContext` copy constructor and add unit test
- extend unit tests to cover relative paths
- fix existing tests to handle newly-required extension in an absolute path
- add functional test that chains relative paths
nits:
- remove some YOLO line wrapping
- `""` -> `string.Empty`
- #3140
- clone `MediaTypeHeaderValue` instance before updating it when content negotiation succeeds
- avoids changes to `MediaTypeConstants` properties and `OutputFormatter.SupportedMediaTypes` entries
- `MediaTypeHeaderValue.Clone()` does not exist in our DNX Core fork of this class
- in previous implementation, was called defensively rather than when required
- update `WebApiCompatShimBasicTest` functional tests to use `MvcTestFixture<TStartup>` everywhere
- #3140 blocked that final migration
- remove `TestHelper` since it's no longer referenced
nits:
- remove comments mentioning `TestHelper`
- correct spelling of "negotiation"
- test class can now use the `MvcTestFixture`
- #3139 part 3 of 3
- dump instrumentation data at end of `_Layout.cshtml`
- include `FilePath` in display
- compare against new `.html` resource
nits:
- normalize line endings to CRLF for consistency with other tests
- add `InstrumentionData` to avoid `Tuple`
- make `TestPageExecutionContext` class `private`
- remove newly-unused actions and associated `.cshtml` files
- remove tests already thoroughly covered in unit tests
- #3139 part 2 of 3
- make checks of `<form>` tag helper more consistent with others
- use a tag helper initializer but testing every variant; covered in unit tests
- remove `MvcStartupTest` and associated web site
- scenario covered elsewhere
- remove `PrecompilationTest.PrecompiledView_RendersCorrectly()`
- scenario covered elsewhere and shouldn't do I/O on checked-in files
- use `MvcTestFixture` instead of `TestHelper`
- part of #3139
- continue to test e2e interaction of `FlushAsync()` with sections, partials, et cetera
- remove `FlushPointTest.FlushBeforeCallingLayout()`
- `RazorPageTest.FlushAsync_ThrowsIfTheLayoutHasBeenSet()` unit test covers the scenario