public async Task <IData> ReadDataAsync(DateTime @from, DateTime to)
        {
            if (to - from > TimeSpan.FromDays(options.MaxDateRange))
            {
                from = to.AddDays(-options.MaxDateRange);
            }

            var url          = $"{options.Url}USD/{from:yyyy-MM-dd}/{to:yyyy-MM-dd}";
            var httpResponse = await httpClient.GetAsync(url);

            var stringMessage = await httpResponse.Content.ReadAsStringAsync();

            if (!httpResponse.IsSuccessStatusCode)
            {
                throw new Exception($"Cannot get exchange rate because: {stringMessage}.");
            }

            var response = JsonConvert.DeserializeObject <ExchangeRatesResponse>(stringMessage);
            var data     = new GoldRatesData
            {
                Name  = "Exchange Rates",
                Rates = response.Rates.ToDictionary(s => s.EffectiveDate.ToDateTime(), s => s.Mid)
            };

            return(data);
        }
        public async Task <IData> ReadDataAsync(DateTime from, DateTime to)
        {
            if (to - from > TimeSpan.FromDays(options.MaxDateRange))
            {
                from = to.AddDays(-options.MaxDateRange);
            }

            var url          = $"{options.Url}?startDate={from:yyyy-MM-dd}&endDate{to:yyyy-MM-dd}&token={options.Token}";
            var httpResponse = await httpClient.GetAsync(url);

            var stringMessage = await httpResponse.Content.ReadAsStringAsync();

            if (!httpResponse.IsSuccessStatusCode)
            {
                throw new Exception($"Cannot get gold rate because: {stringMessage}.");
            }

            var response = JsonConvert.DeserializeObject <IEnumerable <StockExchangeRatesResponse> >(stringMessage);
            var data     = new GoldRatesData
            {
                Name  = "Stock Exchange Rates",
                Rates = response.ToDictionary(s => s.date, s => s.close)
            };

            return(data);
        }