Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can't fire me because I quit! #265

Merged
merged 1 commit into from
May 29, 2014
Merged

You can't fire me because I quit! #265

merged 1 commit into from
May 29, 2014

Conversation

ajcvickers
Copy link
Member

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.

…ts 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.
@lajones
Copy link
Contributor

lajones commented May 28, 2014

Looks good to me. :shipit:

@ajcvickers ajcvickers merged commit 510f234 into dev May 29, 2014
@bricelam bricelam deleted the NoOp527 branch June 3, 2014 17:32
natemcmaster pushed a commit that referenced this pull request Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants