title: Get entity navigation properties after insert
body: <p>I have the following 2 classes:</p>
  
  <pre><code>public class Reward 
  {
      public int Id { get; set; }
      public int CampaignId { get; set;
      public virtual Campaign Campaign { get; set; }
  }
  
  public class Campaign 
  {
      public int Id { get; set; }
      public virtual ICollection&lt;Reward&gt; Rewards { get; set; }
  }
  </code></pre>
  
  <p>With this I have all the obvious necessary stuff like a DbContext and mappings. </p>
  
  <p>Now let's say I create a Reward entity and insert it like this:</p>
  
  <pre><code>var reward = new Reward { CampaignId = 1 };
  context.Set&lt;Reward&gt;().Add(reward);
  context.SaveChanges();
  
  reward = context.Set&lt;Reward&gt;().SingleOrDefault(a =&gt; a.Id == reward.Id);
  //reward.Campaign is null
  </code></pre>
  
  <p>I obviously have a campaign with Id 1 so the FK constraint is happy. After this insert, my reward entity has it's new Identity Id set. Now the problem is that reward is still just the Reward entity I created. And with this, the reward.Campaign property is null. It seems like EF is keeping the inserted entities in memory, and when I then do a .SingleOrDefault(a => a.Id == reward.Id) it simply returns the entity in memory, and not a new proxy. This is probably a good thing.</p>
  
  <p>So the question is: How does one access or load the navigation properties after an insert or get a new proxy that has the navigation properties as proxies as well.</p>
  
  <p>Am I perhaps inserting in the wrong way?</p>