Entity Framework Cascade Delete

前端 未结 2 343
野的像风
野的像风 2020-12-20 02:26

I have Table A and Table B on SQL Server.

Table B has an foreign key to Table A.

I want to cascade delete Table B itens when I delete a Table A item.

相关标签:
2条回答
  • 2020-12-20 02:35

    Set CASCADE on the relationship in the Entity Model Designer...

    0 讨论(0)
  • 2020-12-20 02:40

    On the SQL server, set the Delete Rule in INSERT and UPDATE specification on the relationship property to Cascade.

    0 讨论(0)
提交回复
热议问题