title: linq compare 2 list
body: <pre><code>var companytoexclude = from c in db.Companies
                     from p in c.Projects
                     where p.ProjectEndDate == null
                     select c;
  
  var list = from m in db.Members.Include(&quot;Companies.Projects.Experiences&quot;)
                       where m.MemberId == id
                       select m;
  </code></pre>
  <p>how do I exclude companies that are in companytoexclude in list?</p>
  <p>Member have many company <br/>
  company have many project <br/>
  project have many experiences</p>
  <br>
  <br>
  <p>K I kind of solved it.
  So what I did is just add in</p>
  <pre><code>   foreach (Company c in companytoexclude )
              {
                  list .First().Companies.Remove(c);
              }
              
  </code></pre>
  <p>so is there a easier to show this?
  I want the member with list of companies, not just companies.</p>
  <p>some data</p>
  <pre><code>Member
  MemberId    Name
  2011        Jet
  
  Company
  CompanyId   MemberId    CompanyName
  18          2011            Company1
  29          2011            Company2
  
  ProjectId   CompanyId   ProjectName ProjectEndDate
  1           29          Project1    2008-08-01 00:00:00.000
  2           29          Project2    2009-08-01 00:00:00.000
  3           18          Project3        NULL
  </code></pre>
  <p>now I want it to return everything but company1 and project3</p>