- #EngineeringDay
- Total replaced: 660 Matching files: 270 in *.cs
- Total replaced: 250 Matching files: 32 in all other files
- Total replaced: 22 Matching files: 8 in a few stragglers
Did not change files under following directories
- test\Microsoft.AspNet.Mvc.Razor.Host.Test\TestFiles\Output
- test\Microsoft.AspNet.Mvc.FunctionalTests\compiler\resources
- test\WebSites\TagHelpersWebSite
(Razor generates trailing whitespace in a case or two)
1) Expose the simplified relative path template by cleaning up constraints, optional and catch all tokens from the template.
2) Expose the parameters on the route template as API parameters.
3) Combine parameters from the route and the action descriptor when the parameter doesn't come from the body. #886 will refine this.
4) Expose optionality and constraints for path parameters. Open question: Should we explicitly expose IsCatchAll?
- #874 lines 3, 4, and 6
- correct `Value()` to treat a `null` expression name the same as `string.Empty`
- add missing `[NotNull]` attributes in `EditorExtensions` and for `GenerateIdFromName()`
- consistently pass `null` for default expression names to the helpers
- for example, from extension methods
- add test cases using `null` for expression name
nits:
- correct summary XML comment for `HtmlHelper` class
- use named parameters and prefer interface (not extension) methods in changed calls
- use `string.Empty` instead of `""` in a few tests
This change enables user to specify the tag for the wrapping HTML element
generated from ValidationSummary() and ValidationMessage[For]().
Clean up HtmlHelperValidationExtensions.
- copy from legacy MVC
- get `ListBox[For]()` methods in correct places and working
- also usual stuff: `var`, `[NotNull]`, remove `IDictionary<,>` overloads
- `ListBoxHelper()` -> `GenerateListBox`
- already had all the bits needed in `GenerateSelect()`
- special-case `null` or empty `name` in GenerateSelect()
- ensure `ArgumentException` has correct parameter name
- lower-level problem affected `CheckBox()` as well
- use `ListBox()` and `ListBoxFor()` in MVC sample
- use `ListBox()` in an editor template
- 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
- 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
- copy over legacy MVC's `SelectExtensions`, `SelectListItem` and `SelectListGroup`
- plus expected `SelectList` and `MultiSelectList`
- fixup select HTML helpers to meet WebFx standards and work in new world
- usual stuff: `[NotNull]`, `var`, `String` -> `string`, long lines, ...
- remove `IDictionary<string, object> htmlAttributes` overloads
- move longest extension method overloads into correct classes / interfaces
- add `ViewDataEvaluator.Eval()` overload for an `object` container
- rename lower-level helpers to make purposes more obvious
- nit: move Raw() methods up from bottom of HtmlHelper.cs
- use `DropDownList[For]()` in MVC sample
- add `CheckBox[For]()`, `Hidden[For]()`, `Password[For]()`, and
`RadioButton[For]()`
- also make `FormatValue()` visible to users, as it is in legacy MVC
- and spread the boxes out a bit in MyView 😺
The fix here is to do some cleanup we've been planning to do for a while,
rather than flowing IUrlHelper and IComponentHelper as part of the
ViewContext, they now are just grabbed from the service provider.
This simplifies the code for invoking a view, and gets us closer to the
desired API surface of ViewContext
- copy over from legacy MVC
- fixup namespaces, remove copyright notices, ...
- temporarily remove `RouteBeginForm() overloads
- move main components to `HtmlHelper` and declare in `IHtmlHelper<T>`
- change `UrlHelper` to avoid treating an existing dictionary as an object
- add `HtmlHelper.Createform()` factory
- use in MVC sample; move BeginForm / TextBox samples to a new row
Showcased a lot of the core pieces of DisplayFor in the sample. Some pieces are still missing such as DataType handling. The infrastructure is there to handle it in the TemplateRenderer but the model metadata providers do not construct the metadata with the data types.
Showcased a lot of the core pieces of DisplayFor in the sample. Some pieces are still missing such as DataType handling. The infrastructure is there to handle it in the TemplateRenderer but the model metadata providers do not construct the metadata with the data types.
Showcased a lot of the core pieces of Display in the sample. Some pieces are still missing such as DataType handling. The infrastructure is there to handle it in the TemplateRenderer but the model metadata providers do not construct the metadata with the data types.
Initial draft for DefineSection \ RenderSection. This change is based on
changes to the Razor parser to enable Razor to generate HelperResults for
section instead of void delegates.
- HtmlHelper service now needs an `IModelMetadataProvider` instance
- make `GetInputTypeString()` private
- use `TextBox()` and `TextBoxFor()` in MVC sample
- throw if `ExpressionMetadataProvider.FromLambdaExpression()` returns `null`
- `Name()` is a `virtual` instance method to allow useful derivation
- `NameFor()` is an instance method to avoid adding `GetExpressionName()`
to the public surface; either method could be `virtual`
- `NameForModel()` is an extension method because it's not usefully overridden
- use `Name*()` in sample
- 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