title: Entity Framework: Lazyloading appears to be off despite explicitly turning it on?
body: <p>It would appear that my model first EF set up is not lazy loading related table records despite explicitly turning it on (which I understand I should not have to do since it's model first).</p>
  
  <p>Code follows:</p>
  
  <pre><code>Using db As New Entity()
  
      db.Configuration.LazyLoadingEnabled = True
  
      Dim objectList as List(Of tableName) = _
          db.tableName.Include("relatedTableName") _
          .Where(Function(x) x.col1 = someValue) _
          .OrderBy(Function(x) x.col2).ThenBy(Function(x) x.col3).ToList()
  
      int testVal = 0
  
      For Each item As tableName In objectList
          testValue = item.relatedTableName.idColumn
      Next
  End Using
  </code></pre>
  
  <p>I get a <code>System.NullReferenceException: Object reference not set to an instance of an object.</code> error on this line:</p>
  
  <pre><code>testValue = item.relatedTableName.idColumn
  </code></pre>
  
  <p>In fact, <code>item.relatedTableName</code> doesn't have a value either. I have verified that I should be getting records back by writing an inner join statement in SQL. </p>
  
  <p>What's going on here?</p>