开发者

how to delete the row and its child in entity framework 4

开发者 https://www.devze.com 2023-03-14 09:21 出处:网络
I have a simple and beginner question. I have two table开发者_StackOverflow中文版s with 1 to N relationship. I want to when I delete a row in parent table, in an

I have a simple and beginner question.

I have two table开发者_StackOverflow中文版s with 1 to N relationship. I want to when I delete a row in parent table, in an

other table the child of that row delete too.

How can I do that using entity framework?


Probably it was asked before, refer to the link below:

Delete an object and all of its related entities in Entity Framework

I do believe that you should handle that at Database level by using CASCADE DELETE ON.

0

精彩评论

暂无评论...
验证码 换一张
取 消