例如,我可以将这 3 个表列出示例字段:
作者--> AuthorId、姓名、[...]
书-> BookId,标题,[...]
AuthorBooks --> AuthorId, BookId
如何从多对多表 (AuthorBooks) 中删除行?我想做这样的事情:
var author = db.AUTHORS.Single(x => x.AUTHORID == 1);
var fictionBooks = author.BOOKS.Where(x => x.type == "fiction");
fictionBooks.Delete(); // This is what I want to do
如何在多对多表上执行这样的删除?