This allows model binding to once again be independent of routing. Sending
RouteContext into model binding was an odd choice from a layering
point-of-view.
* Update DataAnnotationsModelValidatorProvider to use ModelMetadata.IsRequired
* Adding tests and updating existing ones that didn't work with IsRequired
Fixes#533
- a single test is failing under CoreCLR only
- using the resource-related properties of a `ValidationAttribute` in
precisely one place – the failing test.
- in .NET the DataAnnotations assembly is somehow able to get access to
`internal` resources
- that doesn’t work under CoreCLR
- short-term fix is to add an `[InternalsVisibleTo]` in the test
assembly, giving DataAnnotations access to the resource
Will also file a bug in the DataAnnotations repo
- correct file and class names for some HH extensions
- three class names were correct but didn't match containing file
- three class and file names matched but didn't start with HtmlHelper
- clean up trailing whitespace and long lines in changed Extensions.cs files
- `HtmlHelperPartialAsyncExtensions`, `HtmlHelperRenderPartialAsyncExtensions`
and `HtmlHelperValidationExtensions` lacked some `[NotNull]` attributes
- merge extension files by concept
- Display / DisplayFor / DisplayForModel methods all into `HtmlHelperDisplayExtensions`
- Partial / RenderPartial methods all into `HtmlHelperPartialExtensions`
- use `IHtmlHelper<TModel>` everywhere
- Remove runtime interface declarations and use
Microsoft.Net.Runtime.Interfaces package
- Made tests compile for net45 and made default
intellisense view net45 for unit tests since Moq
doesn't work
- 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
There are several portions of model validation that attempt to avoid
revalidating if a field has been validated. However the behavior of
ModelStateDictionary makes it difficult to distinguish between an
unvalidated field and a field without validation errors. This change
resolves this issue by letting the caller distinguish between the two
cases.