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
- came from Rendering but Core already had `ArgumentCannotBeNullOrEmpty`
- moved wording from "argument must not be" to "value cannot be"
Also make similar resources consistent in this repo
- adjust Razor's `ArgumentCannotBeNullOrEmpty` resource to use same wording
as Core, adding "The"
- update ModelBinding to also have `ArgumentCannotBeNullOrEmpty` and to use
it consistently with Core and Razor
- 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.
- remove a duplicate using of `System.Collections.Generic`
- FYI `k build` command does not detect this problem
- nit: also cleanup long lines and align wrapped parameters
- HtmlHelper service now needs an `IModelMetadataProvider` instance
- make `GetInputTypeString()` private
- use `TextBox()` and `TextBoxFor()` in MVC sample
- throw if `ExpressionMetadataProvider.FromLambdaExpression()` returns `null`
Copy from:
- some `static` `ModelMetadata` methods -> `ExpressionMetadataProvider`
- `TryGetValueDelegate` -> `TryGetValueDelegate`
- `TypeHelpers.CreateTryGetValueDelegate()`, related bits -> `TryGetValueProvider`
- `ViewDataDictionary.ViewDataEvaluator` inner class -> `ViewDataEvaluator`
- `ViewDataInfo` -> `ViewDataInfo`
- `ViewDataDictionary.Eval()`, related bits -> add to `ViewDataDictionary`
Change to fit in new world:
- usual stuff: `var`, `[NotNull]`, String -> string, namespaces, etc.
- PropertyDescriptor -> PropertyInfo
- update Reflection use
- no `IModelMetadata.Container` property
- improve a couple of variable and parameter names
- make `ViewDataInfo` immutable
- make `ViewDataDictionary.FormatValueInternal` `public` and -> `FormatValue`
- remove `[SuppressMessage]` attributes
- correct `ArgumentNullOrEmpty` and pass parameter name to
`ArgumentException` constructor
- remove `[SuppressMessage]` attributes
- `AnonymousObjectToHtmlAttributes` should return an `IDictionary`
- `var`
- remove straggling copyright notices
- wrap long lines (did not reword any comments)
- align a few parameters