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
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