The code that does an 'UPSERT' of seed data on app start was querying
existing instances and attaching as modified of seed instances on the
same context. Now that we track query results this will throw because
the context has two instances of the same entity (same key value).
Swapping to use a temporary context to query existing data.
- add `IHtmlHelper<T>` and `ICanHasViewContext`
- adjust `HtmlHelper` and `HtmlHelper<T>` to match
- throw if `ViewContext` accessed prior to `Contextualize` call
- XML comments (from old world) all around
Note
- no current need for an `HtmlHelper` copy constructor or `Clone()` method
- expect recursion code to get another injected `IHtmlHelper<T>` and then
"contextualize" that instance with a new `ViewContext`
- start with `FormContext` and classes it needs from legacy world
- FYI `ModelClientValidationRule` came from Web Pages; the rest from MVC
Cleanup and make files compile in new world
- remove `FormContext.GetJsonValidationMetadata` method; will file an
issue to revive this using Json.NET
- don't store `FormContext` in the `HttpContext`, no longer have child
actions
- do `null` checks in setters, not getters (minor perf improvement)
- fix namespaces and usings
- wrap long lines; use `[NotNull]`; no copyright notice
- use explicit comparers for dictionaries
- add XML comment for odd `ModelClientValidationRule.ValidationType`
property
- Collection -> List
1. Adding scripts to self host & custom host Music store
2. Updating readme
3. Cleanup some helper classes that are not necessary.
4. Adding error page middleware for diagnostics.
5. Flipping the switch to run helios on "K" by default.
Compared to legacy MVC:
- correct usings and namespace
- remove `GetFullHtmlFieldId` method; depends on `HtmlHelper` method that
can't be static
- String -> string
- remove reference to a legacy bug
- convert internal `VisitedObjects` property to public `AddVisited()` method
Further cleanup
- remove explicit backing fields for remaining properties
- add copy constructor to replace code distributed around legacy MVC
- don't "combine and trim" in `GetFullHtmlFieldName()`
This was causing intellisense failures in VS. It looks like the
commandline is able to accidentally pick up the compatability extensions
from the model binding assembly, but this is not the case in VS.
Changed this code not to rely on compatability extensions.
We'll need to access the accepted values to do proper link generation, so
separating this process out into 2 parts.
Also moving defaults into the TemplateBinder because they are conceptually
part of the route, not part of the request. I'll do the same for
TemplateMatcher soon, but it's a big change and worth separating.