title: Reload object in an Entity Framework context with updated values
body: <p>I have an EF object that I pull from the db. I then make an update to the corresponding row in the DB through a function call which uses another <code>DBContext</code>. After this update, I would like to reload the contents of the object with the updated contents, however the EF context seems to cache the contents.
  Here's a sample of the code(I've removed some unrelated fluff to make it simpler):</p>
  
  <pre><code>using (UmbrellaEntities context = new UmbrellaEntities())
  {
      var umbrella = (from u in context.Umbrellas
                      where u.umbrellaId == umbrellaId
                      &amp;&amp; !u.deleted
                      select u).Single();
      int oldVersion = umbrella.Version; 
  
      updateUmbrellaVersions(); //perform update on table Umbrella using a new `UmbrellaEntities` object.
      //ideally I'd like to be able to get the updated umbrella.Version without a new call.
  
      var umbrella = (from u in context.Umbrellas
                      where u.umbrellaId == umbrellaId
                      &amp;&amp; !u.deleted
                      select u).Single(); 
       int newVersion = umbrella.Version; //at this point i expect newVersion to be different from oldVersion, since the value in the db has been updated, but that's not the case.
  }
  </code></pre>
  
  <p>I find that I can use a new context to pull the updated context, but this is inefficient.</p>
  
  <pre><code>using (UmbrellaEntities context = new UmbrellaEntities())
  {
          var umbrella = (from u in context.Umbrellas
                          where u.umbrellaId == umbrellaId
                          &amp;&amp; !u.deleted
                          select u).Single();
          int oldVersion = umbrella.Version; 
          updateUmbrellaVersions(); //perform update on table Umbrella using a new `UmbrellaEntities` object.
  }
  
  using (UmbrellaEntities context = new UmbrellaEntities())
  {
          var umbrella = (from u in context.Umbrellas
                          where u.umbrellaId == umbrellaId
                          &amp;&amp; !u.deleted
                          select u).Single();
          int newVersion = umbrella.Version; //we have the right value
  }
  </code></pre>
  
  <p>Is there a way to reload the contents directly after I perform the update? </p>