---
title: "DeserializeObject with Newtonsoft list in a list"  
description: "DeserializeObject with Newtonsoft list in a list"  
author: "Anonymous User"  
published: 2013-06-20  
updated: 2013-06-20  
canonical: https://www.mindstick.com/forum/1237/deserializeobject-with-newtonsoft-list-in-a-list  
category: "json"  
tags: ["json"]  
reading_time: 2 minutes  

---

# DeserializeObject with Newtonsoft list in a list

Hi Expert,\
First off, sorry for my bad English. Hi there, I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to deserialize json (with newtonsoft) to a list, which works great. But my only [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is that I need to put a list inside a list, if this is even possible. Why I want to do this is because I have a set of items with subitems in it. How do I put all of them in a nice sorted list? Here is some example code I made:\
[C# Code](https://www.mindstick.com/forum/403/how-to-export-data-in-excel-file-from-sql-server-using-c-sharp-code)\
**var items = [JsonConvert.DeserializeObject](https://www.mindstick.com/forum/161290/how-does-jsonconvert-deserializeobject-work-in-c-sharp)<List<Items>>(wc.DownloadString("http://localhost/index.php"));****foreach (var item in items)****{** **Console.WriteLine(item);****}****\****listItems.AddRange(items);****\****public class Items****{** **public int ID { get; set; }** **public string Name { get; set; }** **public string Genre { get; set; }** **public string Size { get; set; }** **public string [Version](https://www.mindstick.com/articles/12845/things-to-remember-while-migrating-odoo-to-a-better-version) { get; set; }** **public string Download_Link { get; set; }** **public string Description { get; set; }****}****JSON****\****[** **{** **"id": "1",** **"name": "[Application](https://www.mindstick.com/articles/12824/calculator-application-in-android) 1",** **"genre": "Something",** **"description": "The description",** **"[versions](https://answers.mindstick.com/qa/49863/list-the-versions-of-mac-os-x)": [** **{** **"appid": "1",** **"version": "1",** **"patch_notes": "Release version.",** **"download_link": "http://localhost/downloads/application_1.zip",** **"size": 5120** **}** **]** **}****]****\**My problem is that I can't seem to put the second array inside of the list with the items. I know I'm doing [something wrong](https://www.mindstick.com/forum/12790/something-wrong-with-gridview), but I can't seem to figure out what, could someone please help me with this? It would be very appreciated.\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams) for any recommendations or solutions.\

## Replies

### Reply by Sumit Kesarwani

Hi Ezra,\
In the JSON, Versions is an array. You'll have to model that object as well.\
Your model should look something like this\
**public class Items****{** **public string Id { get; set; }** **public string Name { get; set; }** **public string Genre { get; set; }** **public string Description { get; set; }** **public List<Version> Versions { get; set; }****}****\****public class Version****{** **public string Appid { get; set; }** **public string Version { get; set; }** **public string Patch_Notes { get; set; }** **public string Download_Link { get; set; }** **public int Size { get; set; }****}****\**Thanks in advance.


---

Original Source: https://www.mindstick.com/forum/1237/deserializeobject-with-newtonsoft-list-in-a-list

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
