title: Save detached entity in Entity Framework 6
body: <p>I've read through LOTS of posts on saving a detached entity in Entity Framework. All of them seem to apply to older versions of Entity Framework. They reference methods such as ApplyCurrentValues and ChangeObjectState which do not seem to exist. On a whim I decided to try a method I found through intellisense and I want to make sure this is the correct way to do this since I don't get to see what happening behind the scenes:</p>
  
  <pre><code>public void SaveOrder(Order order)
  {
      using (VirtualWebEntities db = new VirtualWebEntities())
      {
          db.Orders.Attach(order);
          db.Entry(order).State = System.Data.Entity.EntityState.Modified;
          db.SaveChanges();
      }
  }
  </code></pre>
  
  <p><strong>Is this the correct way to update an existing item that was changed?</strong></p>