using System.Collections.Generic;
public static DataSet ToMyDataSet<T>(this IList<T> list)
Type elementType = typeof(T);
DataSet ds = new DataSet();
DataTable t = new DataTable();
foreach (var propInfo in elementType.GetProperties())
t.Columns.Add(propInfo.Name, propInfo.PropertyType);
DataRow row = t.NewRow();
foreach (var propInfo in elementType.GetProperties())
row[propInfo.Name] = propInfo.GetValue(item, null);
[JsonProperty("results")]
public string correct_answer
public List<string> incorrect_answers
public List<Result> results
public static void Main(string[] args)
string json = (new WebClient()).DownloadString("https://opentdb.com/api.php?amount=10&type=boolean");
var ds = JsonConvert.DeserializeObject<RootObject>(json);
Wrapper wrapper = new Wrapper();
wrapper.DataSet = ds.results.ToMyDataSet();
Console.WriteLine(ds.response_code);
Console.WriteLine("Hello World!");