title: Deserialize three level of Json with JsonConvert
body: <p>This is my json:</p>
  
  <pre><code>{
      "Absoluteentry": 6,
      "Name": "ricpez",
      "OwnerCode": 16,
      "OwnerName": null,
      "PickDate": "2018-03-27",
      "Remarks": "",
      "Status": "ps_Released",
      "ObjectType": "156",
      "UseBaseUnits": "tNO",
      "PickListsLines": [
          {
              "AbsoluteEntry": 6,
              "LineNumber": 0,
              "OrderEntry": 417,
              "OrderRowID": 0,
              "PickedQuantity": 0,
              "PickStatus": "ps_Released",
              "ReleasedQuantity": 5,
              "PreviouslyReleasedQuantity": 5,
              "BaseObjectType": 17,
              "SerialNumbers": [],
              "BatchNumbers": [],
              "DocumentLinesBinAllocations": [
                  {
                      "BinAbsEntry": 1,
                      "Quantity": 5,
                      "AllowNegativeQuantity": "tNO",
                      "SerialAndBatchNumbersBaseLine": -1,
                      "BaseLineNumber": 0
                  }
              ]
          },
          {
              "AbsoluteEntry": 6,
              "LineNumber": 1,
              "OrderEntry": 417,
              "OrderRowID": 1,
              "PickedQuantity": 0,
              "PickStatus": "ps_Released",
              "ReleasedQuantity": 6,
              "PreviouslyReleasedQuantity": 6,
              "BaseObjectType": 17,
              "SerialNumbers": [],
              "BatchNumbers": [],
              "DocumentLinesBinAllocations": [
                  {
                      "BinAbsEntry": 1,
                      "Quantity": 6,
                      "AllowNegativeQuantity": "tNO",
                      "SerialAndBatchNumbersBaseLine": -1,
                      "BaseLineNumber": 1
                  }
              ]
          },
          {
              "AbsoluteEntry": 6,
              "LineNumber": 2,
              "OrderEntry": 417,
              "OrderRowID": 3,
              "PickedQuantity": 0,
              "PickStatus": "ps_Released",
              "ReleasedQuantity": 2,
              "PreviouslyReleasedQuantity": 2,
              "BaseObjectType": 17,
              "SerialNumbers": [],
              "BatchNumbers": [],
              "DocumentLinesBinAllocations": [
                  {
                      "BinAbsEntry": 1,
                      "Quantity": 2,
                      "AllowNegativeQuantity": "tNO",
                      "SerialAndBatchNumbersBaseLine": -1,
                      "BaseLineNumber": 2
                  }
              ]
          },
          {
              "AbsoluteEntry": 6,
              "LineNumber": 3,
              "OrderEntry": 417,
              "OrderRowID": 4,
              "PickedQuantity": 0,
              "PickStatus": "ps_Released",
              "ReleasedQuantity": 20,
              "PreviouslyReleasedQuantity": 20,
              "BaseObjectType": 17,
              "SerialNumbers": [],
              "BatchNumbers": [],
              "DocumentLinesBinAllocations": [
                  {
                      "BinAbsEntry": 1,
                      "Quantity": 20,
                      "AllowNegativeQuantity": "tNO",
                      "SerialAndBatchNumbersBaseLine": -1,
                      "BaseLineNumber": 3
                  }
              ]
          },
          {
              "AbsoluteEntry": 6,
              "LineNumber": 4,
              "OrderEntry": 417,
              "OrderRowID": 5,
              "PickedQuantity": 0,
              "PickStatus": "ps_Released",
              "ReleasedQuantity": 1,
              "PreviouslyReleasedQuantity": 1,
              "BaseObjectType": 17,
              "SerialNumbers": [],
              "BatchNumbers": [],
              "DocumentLinesBinAllocations": [
                  {
                      "BinAbsEntry": 1,
                      "Quantity": 1,
                      "AllowNegativeQuantity": "tNO",
                      "SerialAndBatchNumbersBaseLine": -1,
                      "BaseLineNumber": 4
                  }
              ]
          }
      ]    
  }
  </code></pre>
  
  <p>This is my class:</p>
  
  <p>First level</p>
  
  <pre><code>public class ListaPrelievoTestata
  {
      public ListaPrelievoTestata()
      {
          this.PickLines = new List&lt;ListaPrelievoDettaglio&gt;();
      }
  
      public int Absoluteentry { get; set; }
      public string Name { get; set; }
      public DateTime PickDate { get; set; }
      public string Status { get; set; }
  
      public string Remarks { get; set; }
      public string ObjectType { get; set; }
      public string UseBaseUnits { get; set; }
  
      protected List&lt;ListaPrelievoDettaglio&gt; _rows;
      public virtual List&lt;ListaPrelievoDettaglio&gt; PickLines
      {
          get
          {
              if (_rows == null)
              {
                  _rows = new List&lt;ListaPrelievoDettaglio&gt;();
              }
              return _rows;
          }
          set
          {
              _rows = value;
          }
      }
  }
  </code></pre>
  
  <p>Second Level</p>
  
  <pre><code>public class ListaPrelievoDettaglio
  {
      public ListaPrelievoDettaglio()
      {
          this.UbicazioniLines = new List&lt;ListaPrelievoDettaglioUbicazioni&gt;();
      }
  
      public int AbsoluteEntry { get; set; }
      public int LineNumber { get; set; }
      public int OrderEntry { get; set; }
      public int OrderRowID { get; set; }
      public int ReleasedQuantity { get; set; }
      public int PickedQuantity { get; set; }
      public int BaseObjectType { get; set; }
      public virtual ListaPrelievoTestata Lista { get; set; }
  
      protected List&lt;ListaPrelievoDettaglioUbicazioni&gt; _rows;
      public virtual List&lt;ListaPrelievoDettaglioUbicazioni&gt; UbicazioniLines
      {
          get
          {
              if (_rows == null)
              {
                  _rows = new List&lt;ListaPrelievoDettaglioUbicazioni&gt;();
              }
              return _rows;
          }
          set
          {
              _rows = value;
          }
      }
  }
  </code></pre>
  
  <p>Third level:</p>
  
  <pre><code>public class ListaPrelievoDettaglioUbicazioni
  {
      public int BinAbsEntry { get; set; }
      public int Quantity { get; set; }
      public int BaseLineNumber { get; set; }
      public virtual ListaPrelievoDettaglio Lista { get; set; }
  }
  </code></pre>
  
  <p>To parse this I try this but it does not parse the third level:</p>
  
  <pre><code>public static ListaPrelievoTestata DeserializeLista(string json)
  {
      ListaPrelievoTestata it = JsonConvert.DeserializeObject&lt;ListaPrelievoTestata&gt;(json);
  
      JObject details = JObject.Parse(json);
      IList&lt;JToken&gt; res2 = details.SelectToken("PickListsLines").Children().ToList();
      IList&lt;ListaPrelievoDettaglio&gt; detailss = new List&lt;ListaPrelievoDettaglio&gt;();
      foreach (JToken results in res2)
      {
          rowss = results.ToObject&lt;ListaPrelievoDettaglio&gt;();
          detailss.Add(rowss);
          it.PickLines = detailss.ToList();
      }
  
      JObject ubicazioni = JObject.Parse(json);
      IList&lt;JToken&gt; res3 = ubicazioni.SelectToken("PickListsLines").Last().Children().ToList();
      IList&lt;ListaPrelievoDettaglioUbicazioni&gt; listaUbicazioni = new List&lt;ListaPrelievoDettaglioUbicazioni&gt;();
      foreach (JToken results in res3)
      {
          rowsss = results.ToObject&lt;ListaPrelievoDettaglioUbicazioni&gt;();
          listaUbicazioni.Add(rowsss);
      }
      List&lt;ListaPrelievoDettaglioUbicazioni&gt; ubic = new List&lt;ListaPrelievoDettaglioUbicazioni&gt;();
      for (int i = 0; i &lt; it.PickLines.Count(); i++)
      {
          ubic.Add(listaUbicazioni.ToList().ElementAt(i));
          it.PickLines[i].UbicazioniLines = ubic;
          ubic.Clear();
      }
  
      return it;
  }
  </code></pre>
  
  <p>I also tried to take the last child of the list with the method Last() but I always select the first element as well as the method First().</p>