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); }
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."); }
public QueryValidator(BaseValidator baseValidator) { RuleFor(c => c).CustomAsync(baseValidator.MasterKeyDoesNotExists); }
public QueryValidator(BaseValidator baseValidator) { RuleFor(c => c.Password).MustAsync(baseValidator.MasterKeySucessfulyDecrypted).WithMessage("Wrong password."); }