[Blazor] Validate sub-set of model properties
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
It would be very useful to be able to validate only inputs in a form rather than always a whole object. This could be easily achieved if InputBase would ensure EditContext has FieldState for it when it is created, and adding an option on EditContext to validate the field state it holds rather than the whole object.
This approach is useful for Wizard UIs where each step alters a different part of a larger object. The alternative is to copy sub-sets of properties from the target class (along with their validation) and then patch their values into the larger object upon success - but this is too much work.
For illustration purposes only, I cloned the source and provided an example of how the changes might look. https://github.com/mrpmorris/_BlazorValidationChanges_/pull/1/files
Contributor guide
Assessment
This issue has not been assessed yet.