title: Why does Entity Framework return null List<> instead of empty ones?
body: <p>I'm pretty new in the ASP .NET MVC world. Maybe, that's the reason I can't explain to myself the cause of what is, for me, an annoying problem.</p>
  
  <p>I have one class with One-To-Many relashionship. </p>
  
  <pre><code>class MyClass{
      public List&lt;OtherClass&gt; otherClasses {get;set;}
  }
  </code></pre>
  
  <p>When I'm persisting one instance of this class, I fill it's relationship with an empty List&lt;></p>
  
  <pre><code>MyClass myClass = new MyClass(){ otherClasses = new List&lt;OtherClass&gt;() }
  context.myClass.Add(myClass);
  </code></pre>
  
  <p>The problem is that, when I try to retrieve that instance, and for any reason, I try to access that list, system gives me a Null Reference Exception...</p>
  
  <p>My question is: why doesn't EF return empty lists instead of null ones? Especially in this case, that I'm persisting it with an empty list?</p>
  
  <p>There's any way to avoid verifing if instances are null?</p>