static void Main(string[] args) { Exchange CEX = new Exchange(); DollarRates CDR = CEX.GetCurrencyFromOpenExchangeRate(); Console.WriteLine(CDR.rates["DKK"].ToString()); foreach (var item in CDR.rates) { Console.WriteLine("{0} {1}", item.Key, item.Value); } foreach (var item in CDR.RateList) { Console.WriteLine("{0} {1}", item.country, item.value); } Console.ReadLine(); }
static void Main(string[] args) { ClassBIZ CB = new ClassBIZ(); ClassDollar cd = new ClassDollar(); DollarRates DR = CB.useJSON(cd.GetValutaFromOpenExchangeRates()); Console.WriteLine(DR.Rates["DKK"].ToString()); foreach (var item in DR.Rates) { Console.WriteLine("{0} {1}", item.Key, item.Value); } Console.WriteLine(); foreach (var item in DR.RatesList) { Console.WriteLine("{0} {1}", item.Country, item.Value); } Console.ReadLine(); }
public DollarRates useJSON(string value) { DollarRates DR = JsonConvert.DeserializeObject <DollarRates>(value); return(DR); }