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语法。