I\'m trying to accomplish something really simple and I can\'t find how to do it using Entity Framework 4.1.
I want a controller method that accepts an object and
In most cases you do not need to explicitly set the EntityState.Modified unless you've disabled change tracking.
EntityState.Modified
The solution we took was to check the value of the entity identifier:
if (entity.Id == default(int)) { // transient entity so insert } else { // update }