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

Infrastructure: Improve Exception message: Unable to create or track an entity of type 'abc' because it has a null primary or alternate key value. #7001

Closed
rpokrovskij opened this issue Nov 11, 2016 · 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

@rpokrovskij
Copy link

rpokrovskij commented Nov 11, 2016

I have found the difference between Unique Index and Unique constraint: the exception in case of NULL value. In case of Unique Index you have a sqlserver exception with message that contains column name "Cannot insert the value NULL into column...", when in case of Unique Constraint we get InvalidOperationException with generic message: Unable to create or track an entity of type 'TestParentRecord' because it has a null primary or alternate key value.

I propose to add filed names to exception message as sql server do.

EF Core 1.1.0-preview1-final

@rpokrovskij rpokrovskij changed the title Improve Exception message Improve Exception message: Unable to create or track an entity of type 'TestParentRecord' because it has a null primary or alternate key value. Nov 11, 2016
@rpokrovskij rpokrovskij changed the title Improve Exception message: Unable to create or track an entity of type 'TestParentRecord' because it has a null primary or alternate key value. Improve Exception message: Unable to create or track an entity of type 'abc' because it has a null primary or alternate key value. Nov 11, 2016
@divega divega added this to the 1.2.0 milestone Nov 11, 2016
ajcvickers added a commit that referenced this issue Jan 7, 2017
Issue #7001

Includes:
- Null key and conflicting key cases
- Property names
- Help for null alternate key case
- Conflicting key values included when sensitive data logging is enabled
- Updated messages that better reflect current behavior
ajcvickers added a commit that referenced this issue Jan 11, 2017
Issue #7001

Includes:
- Null key and conflicting key cases
- Property names
- Help for null alternate key case
- Conflicting key values included when sensitive data logging is enabled
- Updated messages that better reflect current behavior
@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 Jan 11, 2017
@ajcvickers ajcvickers changed the title Improve Exception message: Unable to create or track an entity of type 'abc' because it has a null primary or alternate key value. Infrastructure: Improve Exception message: Unable to create or track an entity of type 'abc' because it has a null primary or alternate key value. May 9, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Oct 15, 2022
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

3 participants