I have a requirement to make a validation that is not connected with any particular property but depends for example... on the state of the whole application/object etc.
Is FluentValidation supplying any mechanisms for such cases?
I only achieved a workaround using the Custom() method from AbstractValidatior<T>. Sample that allways makes an ValidationFailure for the object (propertName = ""):
Is FluentValidation supplying any mechanisms for such cases?
I only achieved a workaround using the Custom() method from AbstractValidatior<T>. Sample that allways makes an ValidationFailure for the object (propertName = ""):
fluentValidator.Custom(x => new ValidationFailure("", "TEST OBJECT ERROR"));
Is there any other 'cleaner' possibility?