Exemple #1
0
 public CommandValidator(BaseValidator baseValidator)
 {
     RuleFor(c => c.Password).NotEmpty().WithMessage("'Password' field is required.");
     RuleFor(c => c.RetypePassword)
     .NotEmpty()
     .WithMessage("'Retype Password' field is required.")
     .Equal(c => c.Password)
     .WithMessage("Password fields mismatch.");
     RuleFor(c => c).CustomAsync(baseValidator.MasterKeyDoesNotExists);
 }
Exemple #2
0
 public CommandValidator(BaseValidator baseValidator)
 {
     RuleFor(c => c.CurrentPassword)
     .Cascade(CascadeMode.StopOnFirstFailure)
     .NotEmpty()
     .WithMessage("'Current Password' field is required.")
     .MustAsync(baseValidator.MasterKeyDoesExists)
     .WithMessage("'Master key' does not exists.")
     .MustAsync(baseValidator.MasterKeySucessfulyDecrypted)
     .WithMessage("'Current Password' is invalid.");
     RuleFor(c => c.Password).NotEmpty().WithMessage("'Password' field is required.");
     RuleFor(c => c.RetypePassword)
     .NotEmpty()
     .WithMessage("'Retype Password' field is required.")
     .Equal(c => c.Password)
     .WithMessage("Password fields mismatch.");
 }
Exemple #3
0
 public QueryValidator(BaseValidator baseValidator)
 {
     RuleFor(c => c).CustomAsync(baseValidator.MasterKeyDoesNotExists);
 }
Exemple #4
0
 public QueryValidator(BaseValidator baseValidator)
 {
     RuleFor(c => c.Password).MustAsync(baseValidator.MasterKeySucessfulyDecrypted).WithMessage("Wrong password.");
 }