Dec 19, 2011 at 7:27 PM
Edited Dec 19, 2011 at 7:35 PM
So what you're saying:
* define a new validator "MyValidator<T>" which is a subclass of "ConditionValidator<T>"
* that subclass has a copy constructor which accepts an instance of the parent type as an argument
* "ThrowSomethingElse()" is an extension method on an instance of "ConditionValidator<T>"
* it returns a new instance of "MyValidator<T>"
* and... the subclass can throw custom exceptions
This approach is much more intuitive than that in the docs, I like it. But isn't simply throwing a custom exception from the custom validator simpler (surely I get access to the base class from my custom validator anyway)?