public async Task <UserAccountsEditCommand> Handle(UserAccountsEditCommand request, CancellationToken cancellationToken) { try { Accounts currentAccount = _repository.GetByID <Accounts>(request.Id); return(new UserAccountsEditCommand { AccountsUsername = currentAccount.accountUsername, AccountPassword = _passwordEncrypt.DecryptPassword(Globals.encryptKeyGlobal, currentAccount.accountPasswordEncrypt), AccountWebsiteLink = currentAccount.accountWebsiteLink, isValid = true }); } catch { request.isValid = false; return(request); } }
public async Task <UserAccountsDetailsCommand> Handle(UserAccountsDetailsCommand request, CancellationToken cancellationToken) { try { Accounts requestedAccount = _repository.GetByID <Accounts>(request.Id); UserAccountsDetailsCommand requestedDetails = new UserAccountsDetailsCommand { AccountsUsername = requestedAccount.accountUsername, AccountPassword = _passwordEncrypt.DecryptPassword(Globals.encryptKeyGlobal, requestedAccount.accountPasswordEncrypt), AccountWebsiteLink = requestedAccount.accountWebsiteLink }; requestedDetails.isValid = true; return(requestedDetails); } catch { request.isValid = false; return(request); } }