public void VerifyEmail(EmailVerificationToken emailVerificationToken)
 {
     if (!IsVerified)
     {
         if (emailVerificationToken.IsActive)
         {
             IsVerified = true;
         }
         else
         {
             throw new Exception("invalid email verification token.");
         }
     }
 }
        public void SendVerificationRequest(IEmailVerifierService emailVerifier, IAlphanumericTokenGenerator tokenGenerator)
        {
            if (!IsVerified)
            {
                //disable all previous verification tokens
                VerificationTokens.ToList().ForEach(i => i.IsActive = false);

                var newToken = new EmailVerificationToken()
                {
                    VerificationToken = tokenGenerator.GenerateAlphanumericToken(64),
                    IsActive          = true,
                    EmailAddress      = this
                };

                VerificationTokens.Add(newToken);

                emailVerifier.AttemptToVerify(this, newToken);
            }
        }