Page 1 of 1

ef4 delete cascade with Oracle

Posted: Mon 19 Jul 2010 21:03
by skoub
hi!

i have configured my edml to accept delete cascade on a one-to-many relation (in the model part and in the store part). The database schema doesnt have the delete cascade enabled.

When i try to delete the master record, i get an foreign key exception.

i thought that EF4 would do the logic to delete in cascade but it seems not. So how should i configure my delete cascade? Do i need to put it everywhere (database, model and store)?

Posted: Wed 21 Jul 2010 11:37
by AndreyR
You are right, OnDlete="Cascade" should be both in conceptual and store parts of model, and your database should contain this rule. Here is a link about this behaviour:
http://stackoverflow.com/questions/2468 ... d-entities