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

New Post: checking for multiple values in when condition

$
0
0
RuleFor(customer => customer.Forename).NotEmpty().When(customer => customer.Surname.Equals("FOO"));

The above rule only checks if Surname = FOO, how can I write a rule where Surname in ('FOO','BAR', 'ABC','BCD'), Forename cannot be null

Viewing all articles
Browse latest Browse all 1917

Trending Articles



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