I have the following entity tree:
ParameterDefinition-->ParameterOperation
ParameterDefinition-->ParameterGroup-->Parameter
Also there is a many to many relationship (mapped to a FK-FK table) between ParameterOperation and Parameter.
All associations are declared as Delete cascade (only the many to many is not Delete cascade).
The thing is that when I MarkAsDeleted Parameter Object through ParameterOperation
(ParameterDefinition.ParameterOperations[0].Parameters[0].MarkAsDeleted) it is deleted from DB and the map table is updated as well (row is deleted), but when I try to delete Parameter From ParameterGroup
(ParameterDefinition.ParameterGroups[0].Parameters[0].MarkAsDeleted) it is not deleted at all (no delete query is executed on DB).
What might be the problem?
Also how do i delete a many to many relationship? for example I want to keep all Parameters and all ParameterOperations but I want to delete the relationship between Parameters[0] and ParameterOperations[0].
How can I do it?
if I set the NavigationProperty - ParameterDefinition.ParameterOperations[0].Parameters.MarkAsDeleted it actually deleted the Parameter from DB what I don't want