public List <string> GetCurrencies()
        {
            var ret = _cache.GetOrCreate("GetCurrencies", entry => _inner.GetCurrencies());

            if (!ret.Any())
            {
                _cache.Remove("GetCurrencies");
            }
            return(ret);
        }
        public List <string> GetCurrencies()
        {
            var result = new List <string>();

            Polly.Policy.HandleResult <List <string> >(r => r.Count() == 0)
            .Retry(_settings.Retries, onRetry: (result, i) => System.Threading.Thread.Sleep(i * 10000 + 5000)).Execute(() =>
            {
                result = _inner.GetCurrencies();
                return(result);
            });
            return(result);
        }
Пример #3
0
        List <SelectListItem> GetAllCurrencies()
        {
            var list = _currentCalculator.GetCurrencies().Select(r => new SelectListItem
            {
                Text  = r,
                Value = r
            }).ToList();

            list.Insert(0, new SelectListItem {
                Value = "", Text = "Select one"
            });
            return(list);
        }
Пример #4
0
 public IEnumerable <CurrencyData> GetAll()
 {
     return(calculator.GetCurrencies().Select(symbol => calculator.GetCurrencyData(symbol)));
 }