I have a class which is converting from JSON
text
This is my code
SearchResult myojb = (SearchResult)js.Deserialize(objText, typeof(SearchResult));
And the SearchResult
class is
public class SearchResult
{
public List<Datum> data { get; set; }
public int page { get; set; }
public int per_page { get; set; }
public int total_count { get; set; }
public string search_id { get; set; }
}
And DAtum
class is
public class Datum
{
public string id { get; set; }
public string description { get; set; }
public string added_date { get; set; }
public string media_type { get; set; }
public Contributor contributor { get; set; }
public string aspect { get; set; }
public string image_type { get; set; }
public bool is_editorial { get; set; }
public bool is_adult { get; set; }
public bool is_illustration { get; set; }
public bool has_model_release { get; set; }
public bool has_property_release { get; set; }
public List<string> releases { get; set; }
public List<Category> categories { get; set; }
public List<string> keywords { get; set; }
public Assets assets { get; set; }
public List<Model> models { get; set; }
}
I want to convert the List data
of SearchResult
class into datatable
.
for conversion I am using https://stackoverflow.com/a/18100872 answer.
But not understand how to call it with List data
.
Please help stuck with this issue.