public List <Rate> GetRates(DateTime time) { List <Rate> result = JsonRatesParser.FromFreeCurrencyconverterapiCom(GetFCCJson(Currency.CHF, Currency.AUD, Currency.CHF, Currency.CAD)); result.AddRange(JsonRatesParser.FromFreeCurrencyconverterapiCom(GetFCCJson(Currency.CHF, Currency.EUR, Currency.CHF, Currency.GBP))); result.AddRange(JsonRatesParser.FromFreeCurrencyconverterapiCom(GetFCCJson(Currency.CHF, Currency.JPY, Currency.CHF, Currency.USD))); time = DateTime.Now; return(result); }
public async Task <decimal> GetRateAsync(Currency currFrom, Currency currTo) { if (currFrom == currTo) { return(1); } string strRate = await GetFCCJsonSingleAsync(currFrom, currTo); List <Rate> rates = JsonRatesParser.FromFreeCurrencyconverterapiCom(strRate); return(rates[0].Coefficient); }