An exception thrown in a layout (or for that matter anything that is a rendering time exception)
is not bubbling to the end user.
The reason is that the StreamWrite is flushing because it's in a dispose pattern.
The solution is to wrap the stream and prevent writes/flushes if an exception has been thrown.
At the same time we stop writing BOM out to html files by default.
Also specified charset explicitly - so there is matches the encoding of the page.
- copy over legacy `Editor*()` extensions and default editor templates
- get working in the new world
- usual `var`, `String` -> `string`, `internal` -> `public`, namespaces, ...
- longest overloads into `IHtmlHelper[<TModel>]` and implementation classes
- clean up `ViewContext.ViewData` -> `ViewData`, trailing whitespace, long lines
- remove `MultilineTextTemplate()` since `TextArea()` doesn't exist yet
- remove `ColorInputTemplate()` since `Color` type doesn't exist
- use `html.Label()`, not `LabelExtensions.LabelHelper()`: equivalent helper
is protected. only downside is potential `ModelMetadata` re-discovery.
- rename `HtmlInputTemplateHelper()` -> `GenerateTextBox()`
- copy over `Html5DateRenderingMode` and `html.Html5DateRenderingMode` property
- and get them working in new world
- hook the default editor templates up
- use `Editor()`, `EditorFor()`, `EditorForModel()` in MVC sample
- add an on-disk editor template to MVC sample
- no more `IHtmlHelper<object>` in `DefaultDisplayTemplates` and also no
need for `ViewDataDictionary<object>` in a few places
- mostly removals from `IHtmlHelper<TModel>` but did cleanup comments and
add `[NotNull]` for `DisplayFor()`, `DisplayNameFor()`,
`DisplayNameForInnerType()`, and `LabelFor()`
- also add `[NotNull]` for `this` and `Expression` parameters in some
extension methods
This has been compied verbatim from MVC (intentional). The tests have been
modernized a bit as well, but all the cases covered in the original are
there.
This may be moved to HttpAbstractions at some point in the future.
- Config is cleaned up to not have IAdditionalDataProvider and SuppressIdentityChecks.
- Added a DefaultClaimUidExtractor which looks for NameIdentifier and if not present serializes entire claims.
- Added HtmlHelper.
- AntiForgery now returns an AntiForgeryTokenSet which represents a tuple of cookie and form tokens.
- first get old code in correct spot
- then get default templates working in new world
- usual things: `[NotNull]`, `var`, internal -> public
- provide a `HtmlHelper.GenerateOption()` static method
- pass an `ViewDataDictionary<object>` instance to `TemplateRenderer` constructor
- run default templates synchronously with an IHtmlHelper<object>
- copy over resources
- add Microsoft.Data.Entity reference for EntityState type
- use default templates in MVC sample
- remove most on-disk overrides of the default templates
- Renamed it to MvcRouteHandler
- Removed required IServiceProvider ctor param.
- The HttpContext flows the application services through to MVC. This does
require a call to app.UseContainer in order for things to work but that should be fine.
This will be the pattern we use for all frameworks going forward and we'll need to have some
good error handling around this area when things aren't wired up properly.
These are the cases where an interface returns Task, but our
implementation is synchronous. In these cases we prefer to declare the
method as async and suppress, because this keeps the exception semantics
the same as a 'true' async method.
There's an overload that's missing from ActionLink but is present on url
helper, making it very easy to mistakenly pass the wrong data. In the case
of #246, the controller name is treated as the route-values and the
route-values treated as html attributes, leading to the wrong link being
generated.