Commit Graph

7 Commits

Author SHA1 Message Date
Pranav K 088a6fa1ec
Add support for binding record types (#23976)
* Add support for binding record types

* PR feedback

* PR changes

* Changes per PR comments

* Changes per PR comments

* Update src/Mvc/Mvc.Core/src/Resources.resx

* Apply suggestions from code review

* Add some more tests

* Undo blazor.server.js changes

* Fixup test
2020-07-24 08:45:06 -07:00
Pranav K cdae83efae
Use the declared type to infer NullableContextOptions (#15134)
* Use the declared type to infer NullableContextOptions

Prior to this change MVC used the runtime type rather than the declared type to
determine the nullability of a property based on state. In the case of inheritance,
this can be erroneous since the declared type may have a different nullability context
than the model type.

This change addresses this by adding content to `ModelIdentity` that allows inspecting the
declared type.

* Add an overload to `ModelMetadataIdentity` that allows flowing `PropertyInfo`
* Use the declared type in `DataAnnotationsMetadataProvider` to determine nullability based on context.

Fixes https://github.com/aspnet/AspNetCore/issues/14812
2019-10-20 06:30:58 -07:00
Pranav K 504f7f6856
Produce a ModelState error when reading the form throws (#14994)
* Introduce ValueProviderException analogous to InputFormatterException
* Record ValueProviderException as a model state error
* Fixup bug in reading ProblemDetails \ ValidationProblemDetails using the converter

Fixes https://github.com/aspnet/AspNetCore/issues/10291
2019-10-15 16:46:35 -07:00
Pranav K f79f2e3b12
Add some reference docs for MVC (#7981) 2019-02-28 09:56:55 -08:00
Doug Bunting 14b7184c09
Improve documentation of `BinderType` and `BindingSource` properties (#7218)
- add regression test for #4939
- add `[BindProperty]` doc comments
- add `<remarks>` to `BinderType` properties that recommend setting `BindingSource` in some cases

smaller issues:
- catch invalid `BinderType` values up front
- complete `BindingSource.ModelBinding` implementation: `IValueProvider` filtering was faulty

nits:
- accept VS suggestions e.g. remove unused variables
- "model binder" -> `<see cref="IModelBinder" /> implementation` in some doc comments
2019-02-19 15:22:04 -08:00
Ajay Bhargav Baaskaran 7a26d27e8b Merge branch 'release/2.2' 2019-02-14 16:08:51 -08:00
Ajay Bhargav Baaskaran 4cceccd568
Make Mvc repo folder layout consistent (#7518) 2019-02-13 10:53:39 -08:00