This doesn't add any new extensibility, and will likely change again in
the future when we add extensibility. For now this is a stopgap to reduce
duplication between JsonResult and JsonViewComponentResult.
We'll create a scoped service provider if the middleware that does it
isn't there.
We resolve all of our stuff from the scoped service provider, allowing
users to plug in any scoped things they want.
Ported UrlHelper to be a scoped service.
- move `DynamicObject` derivation up to new `DynamicViewData` class, fixing [WebFx-169](http://projectk-tc:8080/browse/WEBFX-169)
- avoid direct `_data` lookup in previous `TryGetMember()`, fixing [#118](https://github.com/aspnet/WebFx/issues/118)
- rename ViewData -> ViewDataDictionary
Also
- flesh out `IDictionary<string, object>` implementation in `ViewData`
- provide `ViewData` copy constructor that allows TModel to change
- remove `TryGetIndex()` and `TrySetIndex()` implementations; use `ViewData[]` instead
- restore `ViewContext.ViewBag` from legacy MVC
Modified ModelState to only ever be created on the ActionContext and then plumbed/exposed it on ViewData and Controller. This will enable: ActionFilterContext's will have access to ModelState via its ActionContext member, allow HTMLHelpers to access ModelState via ViewData, and unify the locations of "source" model state. In the old world we used to copy/replace/instantiate new model state all over unnecessarily.
- demonstrate `ModelMetadata` is available in a view
Also
- simplify `View()` overloads in `Controller`, pending #110 decisions
- make `Model` in `RazorView<T>` readonly
This will be necessary for partials, and for Components.
Basically, the view engine uses a dictionary of data to find the top level
view (for an action) - after we do that, we want this context to be
sticky, which means we need to pass it around. This ensures that partials
and components will be resolved under the same paths as the main view.
Currently this 'data' is just the route values - and there is an ongoing
discussing about the right design here. The data that's being passed WILL
change in the future.
and only use RouteValues (or generically just Dictionary<string, object>).
This is temporary and will change once we get Partials (which are currently just dead code)
For now this will unblock ViewComponents
The changes include:
1. Action executor changes required for supporting sync and async operations Taksk and Task
2. Adding test project for MVC core - This contains ActionExecutor Tests.
3. Also adding a resources file for MVC core project
- add missing `[NotNull]` attributes
- remove now-unneeded usings for ...ModelBinding.Internal namespace
Also get ModelBinding test project working under CoreCLR
- create separate k10 and net45 folders under test in VS
- add `[InternalsVisibleTo]` to make `TypeExtensions` visible to test assembly
- correct tests' `CultureInfo` use to compile under CoreCLR
- ifdef out CoreCLR tests depending on Moq, ReadOnly, ...
- remove a couple of tests expecting TypeConverter to work
1. Areas defined by the Area attribute
2. Areas are a routeconstraint on the actiondescriptor
3. Areas find pages through route values
Other changes:
1. Remove Path from ActionDescriptor - It doesn't make sense with this change
2. Add sample Area
- use Microsoft.AspNet.Mvc.Rendering namespace throughout assembly
Also
- move `IdAttributeDotReplacement` from `TagBuilder` to `HtmlHelper`
- remove commented-out code in `HtmlHelper`
- use `var` and `[NotNull]` more
- `String` -> `string`
- correct Resources references; add missing resources
- add "test" command
- use latest (forked) XUnit packages
update package references
[PropertyData] -> [MemberData]
Xunit.Extensions -> Xunit or Xunit.SDK
Moq now available for .NET 4.5 only
- delete a couple of unit tests checking for ArgumentNullException
- provide TestCommon classes in Razor and Razor.Host test projects
- make ReplaceCulture internal because it's a shared source
This is as simple as modifying the base class to return task and await the ExecuteAsync method. Also added a piece to the sample project to verify functionality.