Hello :)
Here we have a simple implementation of the custom value validators. User have to inherit from a generic ArgumentValueValidator<> and implement validation logic in Validate(YourType value) method. The return type is ValidationResult - a tiny type that provides a simple interface for creating validation results with custom messages.
Basically, there are two abstract types for custom validators: a generic ArgumentValueValidator<> (convenient interface for users) and a non-generic IArgumentValueValidator that used by the framework. I'm not sure about this idea, what do you think?
Hello :) Here we have a simple implementation of the custom value validators. User have to inherit from a generic
ArgumentValueValidator<>
and implement validation logic inValidate(YourType value)
method. The return type isValidationResult
- a tiny type that provides a simple interface for creating validation results with custom messages.Basically, there are two abstract types for custom validators: a generic
ArgumentValueValidator<>
(convenient interface for users) and a non-genericIArgumentValueValidator
that used by the framework. I'm not sure about this idea, what do you think?Example:
Closes #42