Cocona
Cocona copied to clipboard
Can't do Validation across multiple options
Great framework - love it - but I've run into a problem.
We have two separate options on a parameter set: ConnectionString and DbUser If the ConnectionString is specified, DbUser is not required. If the ConnectionString is not specified, then DbUser is required. If neither is specified, then both are required.
A ValidationAttribute is only passed one variable at a time - there is no way to validate the set of options as a whole for consistency. Or am I missing something? There doesn't appear to be a good place to slot in an extra validation step, or to add a validation attribute to the class. :-(