The RazorProject implementation used by MVC at runtime has a constructor
that takes an IFileProvider (used by tests). This causes ambiguities
when a user registers an IFileProvider in DI.
Cleaning up tests to use a mock instead of the file provider directly
If you give ModelExpressionProvider a lambda with a private property
you'll end up here. This wasn't common before, but it seems like users
are more likely to try it with pages.
Model Metadata and Model Binding don't handle private properties, so
supporting it in Model Expressions seems less than useful.
This isn't a breaking change because this case would have resulted in a
null-ref. Addresses #6400
- #5502
- support thousands separators for `decimal`, `double` and `float`
- add tests demonstrating `SimpleTypeModelBinder` does not support thousands separators for numeric types
- add tests demonstrating use of commas (not thousands separators) with `enum` values
- #6076
- add resources and accessors specifically for the element / parameter cases
- avoid `metadata.GetDisplayName()` where possible
- fill in the `ValidationContext` that `ValidatorObjectAdapter` uses
- e.g. `Validate_NestedComplexType_IValidatableObject_Invalid()` test fails without this
Possible future work:
- improve error message used for `ModelMetadata.IsRequired` elements and parameters
- use something besides the type for `ValidationContext.DisplayName` of elements and parameters
nits:
- trailing whitespace
- use more `out var`
This isn't a good fit with consistency with controllers. Discussed with
@DamianEdwards and we agreed to remove this for now and bring it back in
the future if there's a real need for it.
This changeset reckonciles the binding work we did for pages with
controllers.
A quick summary:
- Moves [BindProperty] to the MVC namespace (#6401)
- Makes [FromRoute] and friends behave consistently (#6402)
- Makes [BindProperty] work with controllers (untracked)
* Generate full pdbs for views on desktop and re-enable runtime error tests
StackTraceHelper \ PortablePdbReader used by Diagnostics is only useful for
reading portable pdbs on disk. However pdbs produced by views are entirely
in memory and therefore cannot be read. Consequently
we choose to generate full pdbs for views on Windows (when possible).