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

New Post: Possible to create validator with two types?

$
0
0
Really like your solution, which I've just started playing with.

I note that custom validators override AbstractValidator, which takes a single type as a parameter.

I'd like to create a validator that can take two types, so I can:

given an instance of Foo and an instance of Bar, both having the property "Amount"
Validate that Foo's "Amount" is equal to Bar's "Amount"

Is this something that can be done within the current FluentValidation solution?

Viewing all articles
Browse latest Browse all 1917

Trending Articles



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