If the IsNotEmpty verification fails, would like to skip the other verifications. #2419
Unanswered
onozaty
asked this question in
Questions & Answers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If an empty string is specified for email, both
@IsNotEmpty
and@IsEmail
validation will fail.Two messages are generated.
I want to skip
IsEmail
validation in these cases, since it is sufficient to just tell the user that it is empty.I know that this can be achieved by creating a Custom validation decorator that performs the same checks as
IsEmail
only if it is non-empty.If there is another, simpler solution, I would like to know.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions