title: EF doesn't update navigation property in database
body: <p>I have two classes:</p>
  
  <pre><code>public class Foo
  {
      public Guid Id { get; set; }
      public string Subject { get; set; }
      public TenderType TenderType { get; set; }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class TenderType
  {
      public Guid Id { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>When editing <code>Foo</code> class, when I change <code>TenderType</code> property and use this code:</p>
  
  <pre><code>_db.Entry(tender).State = EntityState.Modified;
  _db.SaveChanges();
  </code></pre>
  
  <p>everything seems to work and my context will refresh with new values, but only properties like <code>Subject</code> has been changed in database! And <code>TenderType</code> still is unchanged in database (not in context)!</p>
  
  <p>Even after calling <code>db.SaveChange()</code> if I execute a fetch Linq query on <code>Foo</code>, context returned a record with the new values! But in database, <code>TenderType</code> still has the old values.</p>
  
  <p>What is this Entity Framework behavior and why?</p>
  
  <p>How can I fix this?</p>
  
  <p>(I use EF 5).</p>