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
DeleteBehavior metadata contains the sentence "Indicates how a delete operation is applied to dependent entities in a relationship when the principal is deleted or the relationship is severed."
ClientSetNull sets the FK to null when the navigation property is set to null (i.e. the relationship is severed). It does nothing when the parent is deleted. When SaveChanges is called with a deleted parent, it sets the FK to null.
The docs, metadata and actual behavior are all mutually distinct in describing when exactly a DeleteBehavior does something.
This might apply to other DeleteBehaviors too, I just tested it with ClientSetNull.
The text was updated successfully, but these errors were encountered:
https://docs.microsoft.com/en-us/ef/core/saving/cascade-delete contains the sentence "[...] control whether the deletion of a principal/parent entity should have a side effect on dependent/child entities it is related to."
DeleteBehavior metadata contains the sentence "Indicates how a delete operation is applied to dependent entities in a relationship when the principal is deleted or the relationship is severed."
ClientSetNull sets the FK to null when the navigation property is set to null (i.e. the relationship is severed). It does nothing when the parent is deleted. When SaveChanges is called with a deleted parent, it sets the FK to null.
The docs, metadata and actual behavior are all mutually distinct in describing when exactly a DeleteBehavior does something.
This might apply to other DeleteBehaviors too, I just tested it with ClientSetNull.
The text was updated successfully, but these errors were encountered: