MVC 3 EF 4.1 dbContext - Deleting one-to-many data object with non-nullable foreign-key relation

前端 未结 4 1127
梦毁少年i
梦毁少年i 2021-02-07 11:46

I am using MVC 3, EF 4.1, and dbContext. I need to know how to delete an entity in one-to-many relation with a non-nullable foreign-key.

When I Remove the child entity

4条回答
  •  我在风中等你
    2021-02-07 12:39

    well, implement your own ICollection and mark those child objects for deletion along with removing it. And then, in your own SaveChanges method override, delete those objects.

提交回复
热议问题