public virtual bool AuthenticateWithCode(Guid accountID, string code, out UserAccount account)
        {
            account = this.GetByID(accountID);
            if (account == null)
            {
                throw new ArgumentException("Invalid AccountID");
            }

            var result = account.VerifyTwoFactorAuthCode(code);

            Update(account);

            return(result);
        }
        public virtual bool AuthenticateWithCode(Guid accountID, string code, out UserAccount account)
        {
            Tracing.Information("[UserAccountService.AuthenticateWithCode] called {0}", accountID);

            account = this.GetByID(accountID);
            if (account == null)
            {
                throw new ArgumentException("Invalid AccountID");
            }

            var result = account.VerifyTwoFactorAuthCode(code);

            Update(account);

            Tracing.Verbose("[UserAccountService.AuthenticateWithCode] result {0}", result);

            return(result);
        }
        public virtual bool AuthenticateWithCode(Guid accountID, string code, out UserAccount account)
        {
            Tracing.Information("[UserAccountService.AuthenticateWithCode] called {0}", accountID);

            account = this.GetByID(accountID);
            if (account == null) throw new ArgumentException("Invalid AccountID");

            var result = account.VerifyTwoFactorAuthCode(code);
            Update(account);

            Tracing.Verbose("[UserAccountService.AuthenticateWithCode] result {0}", result);

            return result;
        }
        public virtual bool AuthenticateWithCode(Guid accountID, string code, out UserAccount account)
        {
            Tracing.Information("[UserAccountService.AuthenticateWithCode] called {0}", accountID);

            account = this.GetByID(accountID);
            if (account == null) throw new ArgumentException("Invalid AccountID");

            var result = account.VerifyTwoFactorAuthCode(code);
            Tracing.Verbose("[UserAccountService.AuthenticateWithCode] result {0}", result);

            if (result && this.Configuration.TwoFactorAuthenticationPolicy != null)
            {
                account.CreateTwoFactorAuthToken();
                Tracing.Verbose("[UserAccountService.AuthenticateWithCode] TwoFactorAuthenticationPolicy issuing a new two factor auth token");
            };
            
            Update(account);

            return result;
        }
        public virtual bool AuthenticateWithCode(Guid accountID, string code, out UserAccount account)
        {
            account = this.GetByID(accountID);
            if (account == null) throw new ArgumentException("Invalid AccountID");

            var result = account.VerifyTwoFactorAuthCode(code);
            Update(account);

            return result;
        }