You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #3374. Spec: docs/design/validation.md. Pull request: #3382.
Discovery by shape: static void Validate(IValidationBuilder<T> v, ...dependencies) and partial classes implementing IValidator<T>; several per type merge.
The builder DSL rewritten at build time: Ensure, EnsureEach, built-in rules, Must/MustAsync, When/Unless, WithMessage/WithCode/WithSeverity/WithName, StopOnFailure, ValidateWith, Include; custom rules through [ValidationRule].
Dependencies become constructor parameters of the generated validator.
Synchronous unless a rule is async; synchronous use of an async validator is a build error with a code fix.
A diagnostic for every statement the generator refuses in a Validate body.
Activity
Validation: function and class validators, and asynchronous rules