Why is ON DELETE SET NULL still not implemented in the Entity Framework 6? Is there a snag?

The feature is probably not implemented because normally changes only affect the objects which are actually in the unit of work. Cascades are not scalable.

And I also think soft deletes are better in most cases. Maybe thats something for you?

You might also want to look into Domain Driven design. That also covers the correct use of units of work (with aggregates).

Btw your solution edits the database in the seed method. It might be better to do that a Up() method of a migration.

Leave a Comment