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

New Post: .When doesn't work

$
0
0
Hi, I am facing a strange problem when I write a rule to validate a field "document"

I coded this way.

RuleFor (model => model.DocumentId)
                 . NotEmpty (). WithLocalizedMessage (() => Resources.Customer.DocumentId)
                 . Length (1, 18). WithLocalizedMessage (() => Resources.Customer.DocumentIdLength)
                 . When (customer =>! Util.ValidateDocument (customer.DocumentId));

But for some reason .When is not working, could someone give me a help?

Thx

Viewing all articles
Browse latest Browse all 1917

Trending Articles



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