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

New Post: Access to rule Expression from ValidationFailure

$
0
0
Hi, thanks for a great framework!

I'm trying to combine FV with an in-house WinForms framework which binds member Expressions to generic WinForms Controls (not columns in a table). The combination would allow me to programmatically highlight controls which have errors from FV. I can use PropertyName and reflection, but this gets complicated quickly with nested members etc. Ideally, I'd have direct access to the Expression, or even the failing Rule, from ValidationFailure, but I'm unable to find any route to this information.

Manually adding the Expression to CustomState for every rule is out of the question - too much repetition, and too error prone. I'm already using a CustomState object to discern warnings from errors, as suggested by another thread.

It would also be helpful to be able to aggregate CustomState objects. As it is, a failure can only have a single CustomState objects.

Viewing all articles
Browse latest Browse all 1917

Trending Articles



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