title: Lambda: using .Include() with linked table data in EF
body: <p>I am trying to filter linked table data using lambda .Include() with the following:</p>
  
  <pre><code>var jobs = db.jobs.Include(d =&gt; d.docs)
             .Where(d =&gt; d.docs.startdate &gt;= date1 &amp;&amp; d =&gt; d.docs.enddate &lt;= date1);
  return View(jobs);
  </code></pre>
  
  <p>This doesn't work though.  Does anyone know what the correct syntax is to filter the linked table data correctly?  Thanks!</p>
  
  <p>UPDATE:</p>
  
  <pre><code>d.docs.startdate
  d.docs.enddate
  </code></pre>
  
  <p>".startdate" and ".enddate" are not showing up in intellisense when I use d.docs.startdate or d.docs.enddate.  I have linked the table relationships and saved the changes but even after using the .Include() command in code, intellisense cannot find the startdate and enddate fields in the docs table through intellisense.</p>
  
  <p>ERROR: 'System.Collections.Generic.ICollection' does not contain a definition for 'duedate' and no extension method 'duedate' accepting a first argument of type 'System.Collections.Generic.ICollection' could be found (are you missing a using directive or an assembly reference?)</p>
  
  <p>...Not sure what I'm missing here?</p>