Ejemplo n.º 1
0
        public SignOverValidator(IProcessQueries queryProcessor)
        {
            CascadeMode = CascadeMode.StopOnFirstFailure;

            RuleFor(p => p.EmailAddress)
            // cannot be empty
            .NotEmpty()
            .WithMessage(FailedBecauseEmailAddressWasEmpty)
            // must be in db
            .Must(p => ValidateUser.NameMatchesEntity(p, queryProcessor))
            .WithMessage(FailedBecauseEmailAddressMatchedNoUser,
                         p => p.EmailAddress)
            ;
        }