Skip to content

Commit

Permalink
Address Email can be null or empty or valid address. (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegoO authored Nov 22, 2022
1 parent f67ef46 commit 2d7af63
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ public class AddressValidator : AbstractValidator<Address>
public AddressValidator()
{
RuleFor(x => x.Email)
.NotNull()
.NotEmpty()
.Must(x => x.IsValidEmail())
.Must(x => string.IsNullOrEmpty(x) || x.IsValidEmail())
.WithMessage("Invalid email format an the address");
}
}
Expand Down

0 comments on commit 2d7af63

Please sign in to comment.