title: Related many to one navigation properties not loading with EF code first
body: <p>I am struggling to get some related navigation properties loading up using EF code first.</p>
  
  <p>I have a User table which is my primary table, which every time you update it, it generates a UserLight object containing only the basics. This is linked via a one-to-one mapping with User, so the User object generates the identity key and then when it saves, a UserLlight object is created using that UserId as it's key.</p>
  
  <p>I now have a conversation object between two users which I want to load in only the UserLight objects for the sender and receiver, for performance reasons. I have tried mapping using Fluent and CF but when I load the objects from my repository, only the UserStartedId and UserRecipientId integer fields are populated, the actual UserLight objects UserStarted and UserRecipient are null. </p>
  
  <p>My conversation class is as follows   </p>
  
  <pre><code>public class DbConversation 
  {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public long ConversationId { get; set; }
  
      public virtual DbUserLight UserStarted { get; set; }
      public int UserStartedId { get; set; }
  
      public virtual DbUserLight UserRecipient { get; set; }
      public int UserRecipientId { get; set; }
  
      public virtual IList&lt;DbStoryMessage&gt; Messages { get; set; }
  }
  </code></pre>
  
  <p>My Userlight class is as follows (abbreviated)</p>
  
  <pre><code>public class DbUserLight 
  {
      public int UserId { get; set; }
  
      [Required]
      [MaxLength(50)]
      public string FirstName { get; set; }
  
      [Required]
      public DateTime DateOfBirth { get; set; }
  }
  </code></pre>
  
  <p>My DbContext OnModelCreating has the following</p>
  
  <pre><code>modelBuilder.Entity&lt;DbUserLight&gt;()
      .HasKey(a =&gt; a.UserId);
  modelBuilder.Entity&lt;DbUserLight&gt;()
      .Property(a =&gt; a.UserId)
      .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
  
  modelBuilder.Entity&lt;DbStoryConversation&gt;()
      .HasKey(c =&gt; c.ConversationId);
  modelBuilder.Entity&lt;DbStoryConversation&gt;()
      .Property(c =&gt; c.ConversationId)
      .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
  modelBuilder.Entity&lt;DbStoryConversation&gt;()
      .HasMany&lt;DbStoryMessage&gt;(c =&gt; c.Messages)
      .WithRequired(m =&gt; m.Conversation)
      .WillCascadeOnDelete(true);
  </code></pre>
  
  <p>And my repository call is as follows</p>
  
  <pre><code>public IQueryable&lt;DbStoryInboxMessage&gt; GetInboxMessages()
  {
      return Work.Context.StoryInboxMessages
          .Include(i =&gt; i.Conversation.UserStarted)
          .Include(i =&gt; i.Conversation.UserRecipient)
          .Include(i =&gt; i.Conversation.Messages);
  }
  </code></pre>
  
  <p>Can anyone shed any light on why this is not working?</p>