Your json can't be directly converted to
Currency
array as it is in the form of key value pair.
I have found that there is one extra comma
","
got added in the last for the json which is creating the problem.
I tried converting the provided json to
Dictionary<string, Currency>
and I got success after removing the incorrect comma from the json.
try this.
string json = "{" +
"\"1\":{\"currency_code\":\"USD\",\"currency_name\":\"USDOLLAR\",\"buy\":\"18990\",\"transfer\":\"18990\",\"sell\":\"19050\"}," +
"\"2\":{\"currency_code\":\"EUR\",\"currency_name\":\"EURO\",\"buy\":\"23596.94\",\"transfer\":\"23667.94\",\"sell\":\"23981.34\"}" +
"}";
Dictionary<string, Currency> list =
new JavaScriptSerializer().Deserialize<Dictionary<string, Currency>>(json);