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(); }
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); } }
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); }