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

update rule #16720

Closed
akghasemi opened this issue Jul 24, 2019 · 3 comments
Closed

update rule #16720

akghasemi opened this issue Jul 24, 2019 · 3 comments

Comments

@akghasemi
Copy link

in classic .NET when you worked with dataset there was a feature called update rule for relations then you could specify what happens to children if you update parent column and if you set it to Cascade then it will automatically update all the related children if you modify parent column, it seems it doesn't exist in Entity framework core. if I am wrong how to implement this? I have Implemented update rule on database side and set relation update rule to cascade but when I try to change the value of the parent column even I haven't load the related children into memory the entityframe work throws an error
The property 'ColumnName' on entity type 'TableName is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key first delete the dependent and invoke 'SaveChanges' then associate the dependent with the new principal.
and this is Odd because it is not a primarykey of table and I have an Id column which EF uses that column to update records in database ,even it doesn't try to send query to server because if it sends the query will succeed because the database has cascade rule.
so I think this is a bug in EF

@ajcvickers
Copy link
Member

Duplicate of #10551 for cascade updates and #4073 for modification of alternate key values.

@akghasemi
Copy link
Author

I don't understand the discussions you have mentioned in your comment . though the discussions belong to long time ago ,can you simply say that is it going to be implemented or it has been implemented or you don't see this as a bug and it would remain as it is now

@ajcvickers
Copy link
Member

@akghasemi Both of the referenced issues are labeled as type-enhancement and are in the backlog milestone. This means that these are features that we are considering implementing, but are not yet scheduled for any release.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants