Validation Aspects contains an AOP validation framework used to validate Objects, Properties and Method Parameters against coding contracts and business rules. Validation can be declared via attributes and/or augmented/replaced programmatically at runtime. WPF integration supported.
Here are some key features of "Validation Aspects":
· Object Validation - Objects can be queried to determine if their state is valid against a set of validation rules. Validation messages and context of what/where validation failed is reported via a ValidationResult.
Property Validation - Multi-Mode validation. The following modes can be enabled or disabled independantly to suit your chosen method of validation:
· - Interception Validation - Validation is invoked when the property is set. If the validation fails, a validation exception will throw to ensure the model does not become invalid.
· - State Validation - Validation is invoked when the object is validated. If the validation fails, the validation failure is added to the ValidationResult.
· Parameter Validation - Parameter validation checks the validity of the value as determined by code contracts and business rules. If the validation fails, a validation exception will throw to ensure the model does not become invalid.
· Real-time augmentation / replacement - Validation can be changed programmatically or via configuration.
· AOP - Validation Aspects are applied to your models by PostSharp. There are no base classes to derive from or interfaces to explicitly implement.
· Custom Validators - Implement new validators easily with minimal code with lambda syntax.
· Strongly-typed validation targets - Compile-time checking ensures validation is correctly declared - you can't declare a numeric validator to validate a string. Validators are implemented to target certain types. Incorrectly declared validators applied at run-time fail fast.
· Integration - Support and samples for WPF. Asp.net MVC server/client-side and Silverlight coming soon.
· Localization - Validation exception messages can be customized with message formatting functions.
· TDD'd - Near 100% code coverage from hundreds of unit tests.
Requirements:
· NET Framework 3.5
· PostSharp v1.0 RTM
What's New in This Release: [ read full changelog ]
· 9366 - PostSharp compilation errors experienced when a [Validate] attributed class derives from a generic base class.
· 9233 - TypeOf.GetProperty(...) returns the base virtual property
· ValidationContext throws if a ValidateObject validator is applied to a method with no arguments
· The new ValidationContext constructor incorrectly populates the Arguments property if the Value argument is null