title: c# Insert item in nested list of objects
body: <p>I have class like this :</p>
  
  <pre><code>public class Abc
  {   
      public int Id { get; set; }
      public List&lt;Abc&gt; Child{ get; set; }
  }
  </code></pre>
  
  <p>I have a nested list of <strong>Abc</strong> like this with two parent items with their children :</p>
  
  <pre><code>Abc (Id = 1)
  |
  |-- Abc (Id = 2)
  |-- Abc (Id = 3)
       |
       |-- Abc (Id = 4)
            |
            |-- Abc (Id =5)
  Abc (Id = 6)
  |
  |-- Abc (Id = 7)
  |-- Abc (Id = 8)
       |
       |-- Abc (Id = 9)
            |
            |-- (Id = 10)
  </code></pre>
  
  <p><strong>==== UPDATE ====</strong></p>
  
  <p>Now that being said, I have two input parameter:</p>
  
  <ol>
  <li>Id = 4</li>
  <li>An object of class Abc (Id = 9)</li>
  <li>An object of class Abc (Id = 11)</li>
  </ol>
  
  <p>I need to find out the object with id 4 in entire list and insert the object in its child only if that object does not exist in the list. </p>
  
  <p>So id = 9 already exists , so I cannot insert. But I can insert the object with Id = 11.</p>
  
  <p><strong>=== UPDATE 2 ====</strong> <br/>
  So after id = 11 is added, the list should look like this.</p>
  
  <pre><code>Abc (Id = 1)
  |
  |-- Abc (Id = 2)
  |-- Abc (Id = 3)
       |
       |-- Abc (Id = 4)
            |
            |-- Abc (Id =5)
            |-- Abc (Id = 11) -- ADDED
  Abc (Id = 6)
  |
  |-- Abc (Id = 7)
  |-- Abc (Id = 8)
       |
       |-- Abc (Id = 9)
            |
            |-- (Id = 10)
  </code></pre>
  
  <p>I do not know how to achieve this. 
  Can anyone please help with this ? It can be c# lambda or linq or any other method.</p>