示例#1
0
        public async System.Threading.Tasks.Task <List <WalletDTO> > GetTransactionsFromUserId(int userId)
        {
            var keylist = await _keyRepo.GetKeysFromUserIdAsync(userId);

            var walletHistoryDTO = new List <WalletDTO>();

            foreach (ExchangeKey key in keylist)
            {
                var walletHistory = await _transactionRepo.GetTransactionsFromKey(key.ExchangeKeyId);

                foreach (Wallet wallet in walletHistory)
                {
                    walletHistoryDTO.Add(ConvertTransaction(wallet));
                }
            }
            return(walletHistoryDTO);
        }
        public async Task <List <ExchangeKeyDTO> > GetExchangeKeys(string name, int userId)
        {
            var keyList = new List <ExchangeKey>();

            if (name == null)
            {
                keyList = await _keyRepo.GetKeysFromUserIdAsync(userId);
            }
            else
            {
                keyList = await _keyRepo.GetKeysFromNameAsync(name, userId);
            }
            var keyDTOList = new List <ExchangeKeyDTO>();

            foreach (ExchangeKey key in keyList)
            {
                keyDTOList.Add(ConvertExchangeKey(key));
            }

            return(keyDTOList);
        }