Good day. Who will tell you how to implement such a thing on the basis of the Entity Framework. There is the essence of the client and there is the essence of the order. Entity order refers to the customer and stores only his ID. How, when a client is deleted, to automatically notify the order (and all other entities that hold the link to the client) that we are going to delete it? And they will already decide (alternatively, throw an exception or return false), whether to allow or not. It is clear that it is worth starting with a subscription to the SavingChanges context event, and a selection of objects to be deleted, but what next? Ideally, it should turn out that when any entity is deleted, notifications will be sent to everyone who has a link to it and who implements the specified interface to support these notifications.

    0