You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
@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.
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
The text was updated successfully, but these errors were encountered: