Adding Validation Rules Using Code
Validation definitions can be built up and added completely though code.
TypeCache is used for adding property and field validations. MethodCache is used for adding validation to the parameters of methods. All types required to perform these actions exists in the namespace.