title: update disconnected object in entity framework
body: <p>I have some data coming from other tiers and it represents an EF object.
  When it's new, I do this:</p>
  
  <pre><code>context.AddToCustomer(mynewobject);
  context.SaveChanges();
  </code></pre>
  
  <p>but now my data forms an existing object, so I want the context to know I want to update the data and not inserting it.</p>
  
  <p>I've seen 'ApplyPropertyChanges' but I can't figure out how to use it.
  I've also seen people doing this:</p>
  
  <pre><code>Customer existingOne = (from n in context.Customers 
                          where n.id = mynewobject.id select n).First()
  existingOne.name = mynewobject.name
  existingOne.address= mynewobject.address
  context.SaveChanges();
  </code></pre>
  
  <p>but that seems a little odd because I have to manually set all the props AND read the entire object first.</p>