-
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
INSERT error (The property 'ID' on entity type 'xxx' has a temporary value) #21555
Comments
This issue is lacking enough information for us to effectively reproduce. Please post a runnable project/solution or complete code listing that demonstrates the behavior you are seeing. |
The same code which can be used in the previous example SHOULD throw it. I have a entry which has multiple entities which can be attached e.g. many to one. When I don't attach them I get the exception. I propose you just null these if they are in the graph and consider them unchanged unless someone adds them / updates or deletes them. (after all the ID will be default and you can easily tell) Why does this throw anyway... should this not just say oh okay I already tracked it, is there a change I don't have if so I will take that otherwise move along. |
As @smitpatel said, please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate. |
The problem is in my current project not the one I will produce (but hopefully I can) The point still stands. Why do we throw at all in these sitations. |
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it. BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions. |
See #9552
Same issue still in 3.1.5
If I remove the Entity property it
Attach
's without issue and I can even useUpdate
Solution
Automatically null the references which are in the entity during the building of the graph in
SaveChanges
, it's annoying and pointless to get this because you can just erase or ignore the references yourself.The text was updated successfully, but these errors were encountered: