Just learning EF, coming from a different ORM tool. I am looking for these delete options. I can't find them so do they exist? Or how are they done in EF?
On Delete: I am familiar with 4 options on a relationship when an object is deleted. I only see one in EF as of now:
- Cascasde (EF has this I see, great)
Deny/Throw (ORM I have used handles this by throwing an exception if you try to delete an object hat has related records for the given relatuionship )
Example: Customer -> Orders (If I try to delete a Customer with related Orders the Delete is denied)
Set Null (ORM I have used handles this by automatically setting the FK to null in the related table)
None (EF has this I see, great) - No Action
Example: DepartmentSupervisor(Employee) <- Department (If you delete the Employee the DepartmentSupervisor FK in the Department table is set to null)