title: Entity Framework CTP 5 - Repository pattern - doing updates
body: <p>How would you do an update operation with CTP 5 using DbContext and using Repository pattern?  Earlier with EF 4.0, it could be done like below.</p>
  
  <pre><code>_context.Customers.AddObject(item);
  _context.ObjectStateManager.ChangeObjectState(item, System.Data.EntityState.Modified);
  </code></pre>
  
  <p>Is there any reason as to why EF does not provide an easy way to update "disconnected" entities. I don't want to query the db and copy all the properties to the object that is returned from query. In other words, EF should have update method which takes in the entity (similar to Add method). If the entitykey already exists in the database, update the entity with the current values. i.e. why should we do "Attach" and then copy all the properties to the attached object. To me it seems redundant to copy all the properties of entities just to update when the "disconnected" object already exist.</p>