Immediate.Validation
Creating validators
In order to use Immediate.Validations, it must be added to the Immediate.Handlers behaviors pipeline by including it in the list of default Behaviors for the assembly:
To indicate that a class should be validated add the [Validate]
attribute and an IValidationTarget<>
interface:
When Nullable Reference Types are enabled, any non-nullable reference types are automatically checked for a null
value. Other validations are available like so:
Referencing Other Properties
Since attributes cannot reference anything other than constant strings, the way to reference static and instance properties, fields, and methods is to use the nameof() to identify which property, field, or method should be used. For example: