title: C# Check if a List is a part of another List
body: <p>I have two lists as follows </p>
  
  <pre><code> var query1 = from enrollments in db.Enrollments
               where enrollments.studentID == studentID &amp;&amp; enrollments.result &gt;= 50 &amp;&amp; enrollments.enrolled == false
               select enrollments.subjectID;
   var query2 = from prerequisites in db.Prerequisites
                where prerequisites.subjectID == subjectID
                select prerequisites.prerequisiteID;
  </code></pre>
  
  <p>Now I want to make sure that all the numbers in query2 exist in query1. In other words, I want to ensure that query2 is a part of query1</p>
  
  <p>Any ideas? </p>
  
  <p>P.S</p>
  
  <p>-You can be sure that <code>subjectID</code> and <code>prerequisiteID</code> are the same thing</p>
  
  <p>-I can convert query1 and query2 to lists like that <code>query.ToList()</code></p>