title: Loading of references in EF7
body: <p>I'm having two classes - author and blogpost:</p>
  
  <pre><code>public class Author
  {
      public Author()
      {
          Blogposts = new HashSet&lt;Blogpost&gt;();
      }
  
      public int Id { get; set; }
      public string Name { get; set; }
      public virtual ICollection&lt;Blogpost&gt; Blogposts { get; set; }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class Blogpost
  {
      public Blogpost()
      {
      }
  
      // Properties
      public int Id { get; set; }
      public string Text { get; set; }
  
      public int AuthorId { get; set; }
  
      public Author Author { get; set; }
  }
  </code></pre>
  
  <p>Using EF7 (beta4), I'm connecting them the following way:</p>
  
  <pre><code>public partial class MyDbContext : DbContext
  {
      public virtual DbSet&lt;Author&gt; Author { get; set; }
      public virtual DbSet&lt;Blogpost&gt; Blogpost { get; set; }
      protected override void OnModelCreating(ModelBuilder modelBuilder)
          {
              modelBuilder.Entity&lt;Author&gt;(entity =&gt;
              {
                  entity.Property(e =&gt; e.Id)
                      .ForSqlServer().UseIdentity();
              });
  
              modelBuilder.Entity&lt;Blogpost&gt;(entity =&gt;
              {
                  entity.Property(e =&gt; e.Id)
                      .ForSqlServer().UseIdentity();
              });
  
              modelBuilder.Entity&lt;Blogpost&gt;(entity =&gt;
              {
                  entity.Reference&lt;Author&gt;(d =&gt; d.Author).InverseCollection(p =&gt; p.Blogposts).ForeignKey(d =&gt; d.AuthorId);
              });
      }
  }
  </code></pre>
  
  <p>When I access a blogpost <code>Db.Blogpost.First(x =&gt; x.Id == id)</code> I retrieve the Blogpost object - however, the <code>.Author</code> property is null. Also, when retrieving any Author object, it's <code>.Blogposts</code> collection is empty.</p>
  
  <p>I understand the EF7 has neither implemented eager-loading nor lazy-loading yet. But how would I then retrieve/assign any objects referenced via foreign key?</p>