-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Model configuration: Incorrect key discovery can result in exception saying another instance has same key, but it doesn't #7049
Comments
Note for triage: Looks like ID in PBase, inherited by Q, is not getting ValueGenerated.OnAdd. Here is the model:
|
Make the temporality of the client generated values depend on whether a value will be generated by the store. Make DatabaseGeneratedOption.Identity attribute just set ValueGenerated to OnAdd on SQL Server. Add a test relational provider so that the purely relational tests can use the correct conventions. Part of #7010 Fixes #7049
Make the temporality of the client generated values depend on whether a value will be generated by the store. Make DatabaseGeneratedOption.Identity attribute just set ValueGenerated to OnAdd on SQL Server. Add a test relational provider so that the purely relational tests can use the correct conventions. Part of #7010 Fixes #7049
…d, this disables client-side value generation for non-key properties that don't have a custom value generator. Make DatabaseGeneratedOption.Identity attribute just set ValueGenerated to OnAdd on SQL Server Update ValueGenerated using conventions Make the temporality of the client generated values depend on whether a value will be generated by the store Add a test relational provider so that the purely relational tests can use the correct conventions Part of #7010 Fixes #7049
…d, this disables client-side value generation for non-key properties that don't have a custom value generator. Make DatabaseGeneratedOption.Identity attribute just set ValueGenerated to OnAdd on SQL Server Update ValueGenerated using conventions Make the temporality of the client generated values depend on whether a value will be generated by the store Add a test relational provider so that the purely relational tests can use the correct conventions Part of #7010 Fixes #7049
My workaround has been to rename my model's "ID" properties to "Id", so I thought the fix would be simply to add |
@HappyNomad The issue is that we aren't always running the conventions. The fix I sent has problems though, so I'll send out a different one. |
The issue can be reproduced with this version:
and this context:
and this model:
The "seeding" code is:
The exception is:
The text was updated successfully, but these errors were encountered: