title: Include nested entities using LINQ
body: <p>I'm messing around with LINQ for the first time, and I'm using EF 4.1 code first.</p>
  
  <p>I have entities containing nested Lists of other entities, for example:</p>
  
  <pre><code>class Release
  {
      int ReleaseID { get; set; }
      string Title { get; set; }
      ICollection&lt;OriginalTrack&gt; OriginalTracks { get; set; }
  }
  
  class OriginalTrack
  {
      int OriginalTrackID { get; set; }
      string Title { get; set; }
      ICollection&lt;Release&gt; Releases { get; set; }
      ICollection&lt;OriginalArtist&gt; OriginalArtists { get; set; }
  }
  
  class OriginalArtist
  {
      int OriginalArtistID { get; set; }
      string Name { get; set; }
      ICollection&lt;OriginalTrack&gt; OriginalTracks { get; set; }
  }
  </code></pre>
  
  <p>I'm wondering what is the quickest way, in one LINQ query, to obtain all the information for where <code>ReleaseID == some value</code>.</p>
  
  <p>I've done my homework, but have found solutions that require implicit rebuilding of an object (usually anonymous) with the required data. I want the data out of the database in the exact format that it is held within the database, i.e. pulling a Release object with relevant ReleaseID pulls and populates all the OriginalTrack and OriginalArtist data in the Lists.</p>
  
  <p>I know about <code>Include()</code>, but am not sure how to apply it for multiple entities.</p>
  
  <p>All help greatly appreciated.</p>