public async Task <IEnumerable <BankAccountDto> > GetAllBankAccountsByUserIdAsync(int userId) { var banks = await _bankAccountRepository.GetAllBankAccountsByUserIdAsync(userId); var accounts = new List <BankAccountDto>(); foreach (var bank in banks) { var bankDto = _mapper.Map <BankAccountDto>(bank); accounts.Add(bankDto); } return(accounts); }