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

Update DeleteBehavior.Restrict to not apply when navigations are changed #10941

Merged
merged 1 commit into from
Feb 12, 2018

Conversation

ajcvickers
Copy link
Contributor

Issue #9703

Restrict now means that EF will never either set an FK to null or perform a cascade delete if an entity is deleted. This is the same as before, although the exception type may change--it's a negative case and we triaged this break as okay. However, if a navigation property is explicitly changed, then the FK associated with that navigation property will still be set to null. This is the change from the previous behavior. This changes some negative cases into positive cases, which was also triaged as okay.

@@ -24,59 +24,75 @@ public abstract partial class GraphUpdatesTestBase<TFixture> : IClassFixture<TFi
protected TFixture Fixture { get; }

[ConditionalFact]
public virtual void Optional_One_to_one_relationships_are_one_to_one()
public virtual DbUpdateException Optional_One_to_one_relationships_are_one_to_one()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we return the exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For provider-specific verification.

Issue #9703

Restrict now means that EF will never either set an FK to null or perform a cascade delete if an entity is deleted. This is the same as before, although the exception type may change--it's a negative case and we triaged this break as okay. However, if a navigation property is explicitly changed, then the FK associated with that navigation property will still be set to null. This is the change from the previous behavior. This changes some negative cases into positive cases, which was also triaged as okay.
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