hi im trying to download data from api and then try some linq on it but i cant even display it normaly. dynamic type works propelly but i cant use linq with it
im using this api http://api.nbp.pl/api/exchangerates/tables/a/?format=json
my class in c#
public class Rootobject
{
public Class1[] Property1 { get; set; }
}
public class Class1
{
public string table { get; set; }
public string no { get; set; }
public string effectiveDate { get; set; }
public Rate[] rates { get; set; }
}
public class Rate
{
public string currency { get; set; }
public string code { get; set; }
public float mid { get; set; }
}
the code to deserialize :
using (WebClient client = new WebClient())
{
String text = Encoding.UTF8.GetString(client.DownloadData("http://api.nbp.pl/api/exchangerates/tables/a/?format=json"));
var Data = Newtonsoft.Json.JsonConvert.DeserializeObject<Rootobject>(text);
Debug.WriteLine(Data);
}
when i put it in array or list (like this)
var Data = Newtonsoft.Json.JsonConvert.DeserializeObject<Rootobject[]>(text);
i can only see the class path