title: Include filter child collection
body: <p>I have some difficulty to add some filter condition for included items in my LINQ query. My query is like</p>
  <pre><code>var item = _Context.Order.Include(&quot;Inner&quot;)
             .Include(&quot;Inner.first&quot;)
             .Include(&quot;Inner.second&quot;)
             .Where(x =&gt; ( !(x.IsDeleted) &amp;&amp; (x.IsActive) &amp;&amp; 
                   (x.itemid == id))).FirstOrDefault();
  
              
  </code></pre>
  <p>In the above code &quot;Inner&quot; is another list of item. Now i need to filter inner items. I only need inner item with filter condition inner.isDeleted = true.</p>
  <p>Query should return a class like,</p>
  <pre><code>public class Order
  {
      public string Name { get; set; }
      public List&lt;InnerDetails&gt; Inner{ get; set; }
      public bool IsDeleted { get; set; }
  }
  </code></pre>
  <p>and InnerDetails class like</p>
  <pre><code>public class InnerDetails 
  {
      public string Sample { get; set; }
      public bool IsDeleted { get; set; }
      public int firstId { get; set; }
      public int secondID { get; set; }
      public First first{ get; set; }
      public Second second{ get; set; }
  }
  </code></pre>
  <p>Can anyone suggest me a better approach to do this because i am new in LINQ and EF?</p>