public async Task UpdateAsync() { string walletId = _settingsService.GetWalletId(); if (string.IsNullOrEmpty(walletId)) { return; } try { IEnumerable <ClientBalanceResponseModel> response = await _balancesClient.GetClientBalances(walletId); Balance[] balances = response .Select(o => new Balance(ExchangeNames.Lykke, o.AssetId, o.Balance, o.Reserved)) .ToArray(); _cache.Set(balances); _traceWriter.Balances(balances); } catch (Exception exception) { _log.ErrorWithDetails(exception, "An error occurred while getting balances from Lykke exchange."); } }