I am using EF4 with the EDM designer. I have two tables : Users and Links. The association between them is that a user can post multiple (*) links and a link can have at most (0..1) one user (the user who posted the link) or none (null).
My goal is that when I delete a user, the FK in all its links is set to null. The problem is that EF4 seems to support only to actions : Cascade and None.
How do I implement the On Delete Set Null rule with EF4?
EF uses this rule by default when working with loaded entities. If you mark loaded user as deleted all loaded links will lose reference to this user. For not loaded entities you must set this rule in the database.