title: In linq to sql how do I include the child entity with initial query?
body: <p>I would like to be able to include a child entity with the main entity in my linq to sql query.</p>
  
  <pre><code>Public Function GetEmployees() As IEnumerable(Of Employee)
      Dim dc As New MyDataContext()
      Return From e In dc.Employee
  End Function
  </code></pre>
  
  <p>In my ASPX page, I want to display the Department of each employee without it having to go back and query the database each time it needs the department name from the department entity for each an every employee.</p>
  
  <pre><code>&lt;asp:repeater...&gt;
     ...
        &lt;%# Eval("FirstName") %&gt;&lt;br /&gt;
        &lt;%# Eval("LastName") %&gt;&lt;br /&gt;
        &lt;%# Eval("Department.Name") %&gt; &lt;--- re-queries db every time on this line?
     ...
  &lt;/asp:repeater&gt;
  </code></pre>
  
  <p>if I change it to include the department, I get an error:</p>
  
  <pre><code>Public Function GetEmployees() As IEnumerable(Of Employee)
      Dim dc As New MyDataContext()
      Return From e In dc.Employee Select e, e.department
  End Function
  
  
  Unable to cast object of type 'System.Data.Linq.DataQuery`1[VB$AnonymousType_0`2[MyNameSpace.Employee,System.Data.Linq.EntitySet`1[MyNameSpace.Employee.Department]]]' to type 'System.Collections.Generic.IEnumerable`1[MyNameSpace.Employee]'.
  </code></pre>