This is for .Net 4.0
In this example, suppose we are dealing with Product objects.
using (DBEntities context = new DBEntities())
{
context.Products.Attach(product);
context.ObjectStateManager.ChangeObjectState(product, EntityState.Modified);
context.SaveChanges();
}
.Net 4.1, "context.Entry(...)" "context.ObjectStateManager.ChangeObjectState(product, EntityState.Modified)", :
context.Entry()
. , , , . , , .