I have the following schema :
When i perform deletion on each model, we need to delete all its children too. Please suggest me the best way. Thanks before.
I have the following schema :
When i perform deletion on each model, we need to delete all its children too. Please suggest me the best way. Thanks before.
i would not advice ever using cascading deletes as you are giving the computer control of what gets deleted/updated this is bad practice. as on large scale database models and top sensitive data if you something deletes its self you are going to be answering question on why has data gone missing.
the best way to delete all child items would be to have two methods
public static class DeleteMenu()
private static class DeleteMenuItems()
in the delete menu method first of all call DeleteMenuItems and remove all children then delete the menu item its self