public async Task <JsonResult> GetRatesJson() { //ICurrencyRates rateSource = new CachedCurrencyRates(new NbrbCurrencyRatesXml()); ICurrencyRates rateSource = new CachedCurrencyRates(HttpContext.Cache, new NbrbCurrencyRatesJson()); var rates = await rateSource.GetCurrentRatesAsync(); return(Json(rates)); }
public async Task <PartialViewResult> GetRatesHtml() { //ICurrencyRates rateSource = new CachedCurrencyRates(new NbrbCurrencyRatesXml()); ICurrencyRates rateSource = new CachedCurrencyRates(HttpContext.Cache, new NbrbCurrencyRatesJson()); var rates = await rateSource.GetCurrentRatesAsync(); return(PartialView("CurrencyRates", rates)); }