I am trying to convert json that I deserialized to a class to a datatable by using the code below ,however the code below fails at the last line.
using (var
If you have only one object serialized then add the square brackets to be parsed to data table correctly.
var json = JsonConvert.SerializeObject(zone, Formatting.None,
new JsonSerializerSettings()
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
});
json = "[" + json + "]";
DataTable table = JsonConvert.DeserializeObject(json);