title: How can I find object in List with Linq?
body: <p>I have a object:</p>
  
  <pre><code>public class MyObject 
      {
          public int Id { get; set; }     
          public List&lt;MyObject&gt; Items { get; set; }     
      }
  </code></pre>
  
  <p>And I have list of MyObject:</p>
  
  <pre><code>List&lt;MyObject&gt; collection = new List&lt;MyObject&gt;();
  
  collection.Add(new MyObject()
  {
       Id = 1,
       Items = null 
  });
  
  collection.Add(new MyObject()
  {
       Id = 2,
       Items = null
  });
  
  collection.Add(new MyObject()
  {
       Id = 3,
       Items = null
  });
  
  
  List&lt;MyObject&gt; collectionMyObject = new List&lt;MyObject&gt;();
  
  collectionMyObject.Add(new MyObject()
  {
       Id = 4,
       Items = collection
  });
  
  collectionMyObject.Add(new MyObject()
  {
       Id = 5,
       Items = null
  });
  </code></pre>
  
  <p>How can I find object with Id = 2 in collectionMyObject with Linq ?</p>