title: Entity Framework Eager Load Not Returning Data, Lazy Load Does
body: <p>I'm using code first <strong>EF5</strong> and I have an object which has a collection defined as <code>virtual</code> (lazy loaded). This returns data when called. However I want it to be eager loaded. I've removed <code>virtual</code> from the property signature but now it always returns <code>null</code> data. <strong>EF doesn't even run the query</strong>, can anyone help?</p>
  
  <p>Edit: I know about <code>.include()</code> I'd just prefer to use the non-virtual property method of doing it.</p>
  
  <p><strong>Objects</strong></p>
  
  <p><code>User</code> (<code>[Key]</code> Id is on Resource object which is the Parent of person class):</p>
  
  <pre><code>namespace Entities
  {
      [Table("Users")]
      public class User : Person
      {
  
      [Required]
      public ICollection&lt;Role&gt; Roles { get; set; } 
  
      }
  }
  </code></pre>
  
  <p>Role:</p>
  
  <pre><code>namespace Entities
  {
      public class Role
      {
          [Key]
          public string Id { get; set; }
  
          public virtual ICollection&lt;User&gt; Users { get; set; } 
      }
  }
  </code></pre>