Chaining Functions

All built-in validation functions are simply extension methods that always return the original IValidatorBuilder<T> instance, therefore allowing validation functions to be chained together.

Validation functions are executed in the order they are defined in the builder. When your validation function is complete, call the Build() method to get the Validator<T> instance.


Example
var validator = new ValidatorBuilder<Employee>() // create builder instance
    .Required(e => e.FirstName)           // first validation function
    .Email(e => e.Email)                  // chaining the second validation function
    .Contains(e => e.Skills, "Moxie")     // chaining third function 
    .Range(e => e.Salary, 50000, 100000)  // chain fourth function
    .LessThanOrEqual(e => e.Commenced, DateTime.Today) // etc...
    .Build();