title: Entity Framework - Include / Reference / Collection
body: <p>I was wondering why there are separate methods for populating navigation properties.</p>
  
  <p>If I work on an entire set, i can call <code>Include</code> on either a property or a collection.</p>
  
  <p>However, if I work on a single entity, there are two separate methods to call depending on whether the item is a collection (<code>Collection</code>) or single reference (<code>Reference</code>).</p>
  
  <p>Is there any way around this - this is making things more complicated than I think is necessary. And could anyone explain why this was decided during designing EF?</p>
  
  <p>EDIT</p>
  
  <p>Looking into it further, the problem goes deeper. What I was trying to do is create a generic way to load collection/navigation properties on a single entity. This can be done easy enough on the whole set using Include. But the method signatures for <code>Reference</code> and <code>Collection</code> are slightly different.</p>
  
  <p>Never mind, will have to scatter these calls around my app.</p>
  
  <p>e.g.</p>
  
  <pre><code>dbSet&lt;T&gt;().Include(e =&gt; e.Property).Include(e =&gt; e.Collection).Include(e =&gt; e.Collection.Property) 
  </code></pre>
  
  <p>all seem to work.</p>
  
  <p>However the calls for the single entity are different:</p>
  
  <pre><code>context.Entry(entity).Reference(e =&gt; e.Property).Load();
  context.Entry(entity).Reference(e =&gt; e.Property.Select(e =&gt; e.SubProperty)).Load();
  context.Entry(entity).Collection(e =&gt; e.Collection).Load();
  </code></pre>