title: LINQ Query: Determining if object in one list exists in another based on key
body: <p>Basically what I'm trying to do is take a list of objects and filter it based on a number of criteria where one of the criteria is that the key doesn't exist in another list.  Here's an example:<br>
  My two classes are similar to this: </p>
  
  <pre><code>public class Test  
  {  
    public string name;  
    public string instructor_name;  
    public string course;  
  }  
  
  public class Appointment  
  {  
    public string site;
    public DateTime forWhen;
    public string testName;
  }
  </code></pre>
  
  <p>I want to sort through a List&lt;Test> by looking at the course and making sure that test doesn't exist in the List&lt;Appointment>.  In SQL I'd do it something like this:</p>
  
  <pre><code>SELECT new Group&lt;Test&gt;(c.Key, c)
  FROM tests in testList
  WHERE tests.Course != "Science"
  AND tests.name NOT IN (SELECT testName FROM appotList)
  </code></pre>
  
  <p>However, I can't figure out how I would do this in LINQ.  Any ideas?</p>