我在M:N关系中有AEntity和BEntity。实体框架 - 从m:n关系中删除M行
在dababase中,我有 ATable, BTable, ABRelationTable。
ABRelationTable建立如下
Id Guid
ATableId Guid
BTableId Guid
AdditionalAttribute1 String
AdditionalAttribute2 String
然后我的EntityFramework删除AEntityInstance和
它抛出一个异常,那么它违反了FK在ABRelationTable
如下:
The DELETE statement conflicted with the REFERENCE constraint "FK_AB_A".
The conflict occurred in database "X", table "ABRelationTable", column
'Id'.The statement has been terminated.
如何删除关系表中的相应行