0
我正在使用EF databaseFrist並創建一個模型,現在在嘗試瞭解如何刪除實體或關係時遇到問題。刪除實體並刪除Entity框架上的關係
免得說已經和表"A"
和表"B"
和"a_b"
表涉及A
和B
通過ID(多對多),a_b
只有id_A
和id_B
,所以沒有在模型中創建實體a_b
。 A
有list<B>
和B
有list<A>
,我需要知道我怎樣才能進行下一個功能:
-Remove all B entities related to A, it means delete the rows of B.
-Remove only the relationships of A to B, so all entities still exist on DB but they are dissociated.
-Delete A and remove all B related as well (remove entities from DB).
-Delete A and preserve all B entities.
-How will it change if a_b has any other property so it becomes an entity
感謝您的時間。
pd:我正在使用Lambda語法。