title: ObjectContext update an object from a detached state
body: <p>I have an ObjectContext with an update method.  The method takes a generic object as a parameter.  I need to attach this object to the ObjectContext and update the database with the changes the object had.  example, I create a new object that has the same key as and entity in the database but some of the fields are different.  I want to attach the object to its corresponding entity in the database and have it save the changes the new object has. Here is what i have in the Update method:
  <br /></p>
  
  <pre><code>public void Update(BaseObject data, entitySetName)
  {
      AttachTo(entitySetName, data);
      Refresh(RefreshMode.ClientWins, data);
      SaveChanges();
  }
  </code></pre>
  
  <p>After the refresh, the data get overwritten by the fields from the database. Leaving out the refresh also does not update the database record. Am I missing a step?</p>