* Convert `RouteValueDictionary` values to `string` using `CultureInfo.InvariantCulture`
- #8578
- user may override this choice in one case:
- register a custom `IValueProviderFactory` to pass another `CultureInfo` into the `RouteValueProvider`
- values are used as programmatic tokens outside `RouteValueProvider`
nits:
- take VS suggestions in changed classes
- take VS suggestions in files I had open :)
- #6662
- users can now provide a `name` or `data-valmsg-for` attribute to avoid `ArgumentException`s
- affects `<input>`, `<select>`, `<textarea>` elements and validation message `<div>`s
- remove `fullName` check in `DefaultHtmlGenerator.GetCurrentValues(...)` entirely
The new workaround is _not_ identical to changing `ViewData.TemplateInfo.HtmlFieldPrefix`
- does not change where expression values are found in `ModelState` or `ViewData`
- likely needs to be combined with additional workarounds i.e. for advanced use only
nits:
- clean up some excessive argument naming; add a few missing argument names
- take VS suggestions in changed classes e.g. inline a few variable declarations
- clean up some test data
- This functionality can be disabled by setting the `Switch.Microsoft.AspNetCore.Mvc.AllowJsonHtml` switch in an app.config.
- Updated tests to react to this new behavior.
- Exposed a new `PublicSerializerSettings` property on `JsonOutputFormatter` so we can accurately copy settings from the used output formatter in `JsonHelper`.
We have all of these executors but they aren't really
documented/supported for extensibility today. This change introduces a
pattern for action result executors so we can make them extensible.
This change logs when we encounter and exception reading temp data from a
cookie and swallows the exception. Additionally, we clear the cookie so
that this won't happen on subsequent requests.
This will handle cases where data protection is misconfigured, or a
request just has general garbage in the cookies.
- #5028
- helpers similar to our HTML or tag helpers can use the new singleton to examine or add validation attributes
- in the most common case, helpers add validation attributes to a `TagBuilder`
- separate `DefaultValidationHtmlAttributeProvider` from `DefaultHtmlGenerator`
- avoids creating two instances of the `DefaultHtmlGenerator` singleton
- would be even uglier to require callers to cast an `IHtmlGenerator` to `ValidationHtmlAttributeProvider`
- `[Obsolete]` old `DefaultHtmlGenerator` constructor
- #4116
- generalize rules for `ModelMetadata` creation; minimize metadata changes when Model is updated
- down to a single special case in VDD for `Nullable<T>`
- note existing functional tests did not need to change
- remove `ViewDataDictionary(ViewDataDictionary, object)` constructor; use `new VDD<object>(source, model)`
- allow all `Model` assignments in a view component
- copy-constructed VDD in `ViewComponentContext` previously preserved the source's declared type
nits:
- do not call `virtual SetModel()` method from constructor; now mostly redundant
- logic in copy constructor and `SetModel()` is consistent but different enough to keep code separate
- add some missing doc comments
- fix doc comment property versus type confusion; never need to specify `ViewDataDictionary.` prefix
- fix a few `TemplateBuilder` comments and remove unnecessary `model: null` argument to VDD constructor