- #3215
- add new accessor properties to `IModelBindingMessageProvider` and plumb them through
- use in `ModelStateDictionary` when handling a `FormatException` or `OverflowException`
- use in `ValidationHelpers` when handling a `ModelError` with `null` `ErrorMessage`
- add new `ModelExplorer` parameter to `IHtmlGenerator.GenerateValidationMessage()`
- plumb through to `ValidationHelpers.GetModelErrorMessageOrDefault()`
Started from work @kichalla did on the `kiran/movemessages-to-messageprovider` branch in #3775.
nits:
- use helper methods more consistently in `HtmlHelper<T>`; slightly improves error checking
- remove unused `Resources` class from `Microsoft.AspNet.Mvc`
- make `ValidationHelpers` class `public`; already in `.Internal` namespace
- split `GetUserErrorMessageOrDefault()` in two; rename to `GetModelErrorMessageOrDefault()`
- fix some #YOLO wrapping
- wrong fix especially now that test encoders work as expected
- touch up `HtmlHelperTest` and `RazorViewTest` since test encoders are now consistent
- remove references to old `Microsoft.Extensions.WebEncoders.Testing` package
This reverts commit a9d5876cd9.
- but leave `FormTagHelperTest` and `ValidationMessageTagHelperTest` cleanup alone
nit: use `string.Empty` in `HtmlHelperLinkGenerationTest`
- #2969
- add `ModelBindingMessages` for configuration and `IBindingMetadataProvider` overrides
- use `interface` to avoid `new` oddities when adding a setter to an `abstract` property
- add `IModelBindingMessages` to `ModelMetadata` for use in rest of the product code
- plumb the various bits through the system
- add integration tests using a custom `IBindingMetadataProvider`s to override messages
nits:
- remove unused resources
- use `AttemptedValue` and not `model` in `SimpleTypeModelBinder`
- use `[ConditionalFact]` or `[ConditionalTheory]` instead
- in some cases test was already conditional
- move other `IsMono` checks into data sets where possible
- not reported as skipped but at least not counted as successful
nit: switch from `[ConditionalTheory]` to `[ConditionalFact]` as appropriate
- slightly more efficient since xUnit won't check for data