title: How to include list based on a condition in LINQ
body: <p>I have this code:</p>
  
  <pre><code>ClassroomList.Where(x =&gt; x.StudentList.Any(y =&gt; y.IsMale) == true);
  </code></pre>
  
  <p>this code returns <code>ClassroomList</code> only if all student in StudentList <code>IsMale == true</code> but returns none if there is at least 1 <code>IsMale == false</code>.</p>
  
  <p>How do I always return ClassroomList that only includes those Students with <code>IsMale == true</code>.</p>
  
  <p>Here is ClassroomList's Class:</p>
  
  <pre><code>public partial class ClassroomList
  {
      public ClassroomList(){}
      public list&lt;Student&gt; StudentList {get; set;}
  }
  </code></pre>
  
  <p>Here is Student Class:</p>
  
  <pre><code>public partial class Student 
  {
      public Student (){}
      public bool IsMale {get; set;}
  }
  </code></pre>
  
  <p>Here's a sample of the expected output</p>
  
  <pre><code>Classroomlist Count |  Studentlist Count |  Male | Female | 
           2                    5              3       2       
           2                    10             10      0
           2                    8              0       8
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>1. ClassroomList[1].Studentlist[2]
  2. ClassroomList[1].Studentlist[9]
  3. ClassroomList[1].Studentlist == null
  </code></pre>