title: Entity Framework 6 navigation collections are null instead of empty
body: <p>I'm trying to write a relational database application using Entity Framework 6. I have classes analogous to:</p>
  
  <pre><code>public class Subject
  {
      public int ID { get; set; }
      public string Name { get; set; }
      public virtual ICollection&lt;Student&gt; Students { get; set; }
  }
  
  public class Student
  {
      public int ID { get; set; }
      public int SubjectID { get; set; }
      public string Name { get; set; }
      public virtual Subject Subject { get; set; }
  }
  </code></pre>
  
  <p>(OK this is a bad example because in reality you'd want each student to be in more than one subject but let's ignore this for now as it was the best example that I could think of.)</p>
  
  <p>The problem is that, whenever there's a subject with no students, instead of <code>subjectInstance.Students</code> returning an empty collection it instead returns <code>null</code>. This means that I cannot call <code>subjectInstance.Students.Add(studentInstance)</code> to add the first student. I instead have to add the student separately, by calling <code>contextInstance.Students.Add(studentInstance)</code> after manually setting the <code>SubjectID</code> field on <code>studentInstance</code>. Once there's one or more students already associated with the subject, <code>subjectInstance.Students</code> is no longer null and I can add further students in the expected way.</p>
  
  <p><strong>What I've already tried:</strong></p>
  
  <ul>
  <li><p>Removing <code>virtual</code> from <code>public virtual ICollection&lt;Student&gt; Students { get; set; }</code> - no change</p></li>
  <li><p>Calling <code>contextInstance.Entry(subjectInstance).Collection("Students").Load()</code> before attempting to access the collection - works but it's messy and breaks separation of concerns (the modules that work with the data shouldn't have to concern themselves with loading the data)</p></li>
  <li><p>Calling <code>contextInstance.Subjects.Include("Students")</code> at some point before creating <code>subjectInstance</code> - no change</p></li>
  </ul>