-
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
Exception in TPT models with default values #23180
Comments
I can reproduce this on the 5.0 daily build; it does not repro when switched to TPH. Could be an update pipeline or change tracking bug. |
@ajcvickers When propagating the store-generated value to the FK we set the FK store-generated value to |
@AndriySvyryd So, does TPT make this common enough that we should patch for #22603? |
@ajcvickers Yes. In TPH there are no store-generated values in the Ferrari entry at that point so we don't have to reset them to I haven't tried it, but inserting a dependent with 2 principals would likely hit this without TPT. |
Thank you guys, this was driving me crazy. I've tried to build branch Issue23180 and it is now working! Hope it will get into daily builds soon. |
This looks like the issue I'm having on #23158, in which a dependent with two principals is being set to null, thus removing those now-null entries when saving changes again like @AndriySvyryd mentioned. Looking forward to the fix! |
@AndriySvyryd Will your fix be available in some nightly Alpha/Beta channel? |
I use following version of EF Core:
I have following classes:
I have following code:
Reference to Special is getting nulled. The output is following:
You can try yourself: https://github.com/dagid4/EfCoreBug
In database everything is ok. Do you have please any idea how to solve this problem? Or is it just a bug?
It can be related to derived classes. If you move the Special property from Ferrari into Car, it is working.
The text was updated successfully, but these errors were encountered: