0

I am quite new to EF and i am stumbling uppon finding a clean solution, for deleting reference Entities:

public class UserAccess : CloneableBaseEntity<UserAccess> { public User User { get; set; } public Site Site { get; set; } public CostCenter CostCenter { get; set; } public Product Product { get; set; } } 

Case 1:

When a User is deleted, also the User Access should be deleted

Case 2

When a Product is deleted the Useraccess should be still there.

Any ideas?

0

1 Answer 1

1

Mark the relationship between User and UserAccess to have a Cascade Delete.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.