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 committed Nov 22, 2022
1 parent fd01683 commit 4a37e78
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 4a37e78

Please sign in to comment.