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

Better SaveChanges exception messages for "conceptual nulls" #10170

Closed
ajcvickers opened this issue Oct 26, 2017 · 0 comments
Closed

Better SaveChanges exception messages for "conceptual nulls" #10170

ajcvickers opened this issue Oct 26, 2017 · 0 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@ajcvickers
Copy link
Member

The normal "conceptual null" message is:

The association between entity types 'Blog' and 'Post' has been severed but the foreign key for this relationship cannot be set to null. If the dependent entity should be deleted, then setup the relationship to use cascade deletes.

However, this can be confusing if:

  • The relationship was severed because the principal was deleted--the message above is correct, but additional information should be included so that the deletion can be identified as the root cause.
  • The key is nullable--in this case it's not that the key can't be set to null, but rather that the relationship is configured with Restrict such that the key is not set to null automatically.
@ajcvickers ajcvickers self-assigned this Oct 30, 2017
@ajcvickers ajcvickers added this to the 2.1.0 milestone Oct 30, 2017
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview1, 2.1.0 Jan 17, 2018
ajcvickers added a commit that referenced this issue Feb 26, 2018
Issues:
#221 Change tracker logging
#9291 Non-nullable bool warning--only inserts, and only if constraint is used by EF
#9761 Naked store type shows property
#10170 Conceptual null message
#10435 Cascade delete logging
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Feb 26, 2018
ajcvickers added a commit that referenced this issue Feb 27, 2018
Issues:
#221 Change tracker logging
#9291 Non-nullable bool warning--only inserts, and only if constraint is used by EF
#9761 Naked store type shows property
#10170 Conceptual null message
#10435 Cascade delete logging
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview2, 2.1.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

1 participant