Skip to content

M to M-deleting relationship plus item on other side #237

@cbgreely

Description

@cbgreely

I have an M to M relationship. I'll use Employees and Territories as an example, with an intersection table between (let's call it Employee_x_Territories). I am trying to remove the relationship between an Employee and a Territory, plus the Territory record at the same time (it is the only use of the specific Territory...no other Employees link to it). Employee_x_Territories is a change tracking collection in Employee. I am able to remove the relationship by removing the specific Employee_x_Territories entity from that change tracking collection, but I am unable to remove the Territory record itself by setting the Territory record's TrackingState property to Deleted. The result of GetChanges is a deleted Employee_x_Territories record, with a Territory property of null. I expected the Territory property to be the Territory record with a TrackingState of deleted.

Hope that is understandable. Can you tell me what I may be doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions