Reputation: 2084
I have added Cascade Delete to my database but I do not see this update in my model. How do I make sure that my model has cascade delete enabled for a database first model?
Upvotes: 1
Views: 2158
Reputation: 847
If the cascade delete is set on the database then you have nothing to worry about. Deleting the main Object would translate on
It would be more cumbersome if you only had the cascade delete on the Model but not the Database, as that would mean the EntityFramework try to figure out all of the above on runtime.
If you really want to ensure the cascade delete, you could enable it in both layers, although it doesn't sound like a good idea to me as some data "might disappear" (because it was cascade deleted) from the EF state manager.
Upvotes: 2