aspnet/EntityFramework — pull request #265 by ajcvickers (2014-05-28 22:36:52+00:00)
Title: You can't fire me because I quit!

You can't fire me because I quit! (Change from Added to Deleted results in detached entity)

See issue #351. When an entity is in the Added state it means that it doesn't exist in the database and should be inserted during SaveChanges. If the state is then changed to Deleted this would mean delete an entity that doesn't exist in the database, which will fail. In the EF6 stack we instead detach the entity in this case so that it is just never inserted. This change implements the same behavior in EF7.