Parameter Validation
EasyValidate automatically generates validation methods for your method parameters and constructors using attributes. Get compile-time safety with zero runtime reflection overhead.
Real Examples from EasyValidate
See actual parameter validation in action with real code from the EasyValidate test suite.
Validation Process Flow
Understand how EasyValidate processes validation chains and handles errors.
Call Validation Overload
Call the generated method with ValidationConfig parameter
Validate Parameters
Each parameter with attributes is validated in sequence
Execute Original
If all validations pass, original method is called
Return Result
IValidationResult with the method's return value
Call Factory Method
Call the static Create (or custom named) factory method
Validate Parameters
Constructor parameters with attributes are validated
Create Instance
If valid, constructor is called to create the instance
Return Result
IValidationResult<T> containing the new instance
Validation Fails
Any validation attribute returns invalid result
Short-Circuit
Remaining validations in chain are skipped for performance
Error Details
Detailed error information including attribute and value
Result Returned
IValidationResult with IsValid = false and error details