I have 1 to many relationship tables in SQL and I am using EF in MVC. I would like to get all relational child from parent table. relationship is setup on DB level. PK to FK etc.
I want to delete entity with child (and child of child).
please advise.
Thanks
In the model configuration, you need to define child properties relations with WillCascadeOnDelete()
Plenty of examples are available on MSDN. For starters check here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.