コード例 #1
0
        public void UpdateLastLogin(string userId)
        {
            var query = new ByUserId
            {
                UserId = userId
            };

            var updatedUser = _userGetByUserId.Retrieve(query);

            updatedUser.LastLogin = _systemTime.Current();

            _userUpdater.Update(updatedUser);
            _userUpdater.Save();
        }
コード例 #2
0
        public void DeleteAccount(UserAccount existingAccount, Credentials existCredentials)
        {
            var authenticationResult = _userAuthProvider.Authenticate(existCredentials);
            if (authenticationResult.WasSuccessful)
            {
                _userAuthProvider.DeleteCredentials(existCredentials);

                var query = new ByUserId
                {
                    UserId = existingAccount.UserId
                };

                var existingUser = _userGetByUserId.Retrieve(query);
                _userDeleter.Delete(existingUser);
            }
        }
コード例 #3
0
        public UserAccount UpdateAccount(UserAccount existingAccount, Credentials existCredentials)
        {
            var query = new ByUserId
            {
                UserId = existingAccount.UserId
            };

            var updatedUser = _userGetByUserId.Retrieve(query);

            updatedUser.Email = existingAccount.Email;
            updatedUser.FirstName = existingAccount.FirstName;
            updatedUser.LastName = existingAccount.LastName;

            _userUpdater.Update(updatedUser);
            _userUpdater.Save();

            return _translateDataUserToUserAccount.Translate(updatedUser);
        }