title: How to refresh and entity object after a newly created object context
body: <p>Lets say, i have an <code>EntityObject</code> called <code>someProduct</code> :</p>
  
  <pre><code>//Get the object
  Product someProduct = someObjectContext.Product.First();
  
  //At runtime at some point, recreate the ObjectContext
  someObjectContext = new SomeObjectContext();
  
  //Try to refresh someProduct on the new ObjectContext
  someObjectContext.Refresh(RefreshMode.StoreWins, someProduct);
  </code></pre>
  
  <p>When the third line executes, it throws an exception:</p>
  
  <blockquote>
    <p>The element at index 0 in the collection of objects to refresh has a null EntityKey property value or is not attached to this ObjectStateManager.</p>
  </blockquote>
  
  <p>Is this the correct way to refresh the <code>EntityObject</code> on a newly create <code>ObjectContext</code>?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The reason for new <code>ObjectContext</code> is to refresh all the dirty <code>EntityObjects</code>.</p>