LINQ and associations - When is an Include() required?
<p>This LINQ works as expected and brings back the <code>Department</code> entity associated with a given <code>Employee</code></p>

<pre><code>Employees.Where(e =&gt; e.EmployeeId == 10).Select(e =&gt; new {e.Department})
</code></pre>

<p>However a similar LINQ expression fails saying <code>Department</code> is null</p>

<pre><code>Employees.Where(e =&gt; e.EmployeeId == 10).Department 
</code></pre>

<p>The first LINQ statement is able to determine the association between <code>Employees</code> and <code>Department</code> yet the second LINQ expression cannot. If I use the <code>Include("Department")</code> statement in the second LINQ example then it will work and <code>Department</code> will not be null.</p>

<pre><code>Employees.Include("Department").Where(e =&gt; e.EmployeeId == 10).Department
</code></pre>

<p>Why is Include("Department") not required in the first LINQ statement?</p>