public async Task <IEnumerable <ExchangeModel> > GetExchangeRatesFromTo(string currency, DateTime dateFrom, DateTime dateTo)
        {
            var result = new List <ExchangeModel>();

            for (var date = dateFrom.Date; date.Date <= dateTo.Date; date = date.AddDays(1))
            {
                result.Add(await _ratesProvider.GetRate(currency, date));
            }

            return(result);
        }
Exemplo n.º 2
0
 public ActionResult Index()
 {
     ViewBag.Rate = referenceExchangeRateProvider.GetRate(1).Rate;
     return(View());
 }