Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: Non-property oriented validation

$
0
0
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 = ""):
fluentValidator.Custom(x => new ValidationFailure("", "TEST OBJECT ERROR"));
Is there any other 'cleaner' possibility?

Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>