0

I have a simple and beginner question.

I have two tables 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?

Filipi Braga
  • 31
  • 1
  • 13
mo_al
  • 101
  • 1
  • 9

1 Answers1

0

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.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
DotNetInfo
  • 3,344
  • 6
  • 33
  • 39
  • I do that but there is a error : An error occurred while updating the entries. See the inner exception for details. my code is : – mo_al Jun 22 '11 at 08:12
  • could you please provide more detail as I won't be able to solve with this much info – DotNetInfo Jun 22 '11 at 09:37