开发者

Remove Many-to-many relations records in database with entity framework

If I have many to many relation ship in database witch is looking like that:

House-HouseType-Type

In data model it is looking like that

House-Type

I cant modify table HouseType directly because there is no entity for that.

For example if I have insert some entities in database after records in table HouseType looking 开发者_Python百科like that:

HouseId TypeId
1       2
1       3
1       4

than I want to remove some relations records.

e.g Records in table after remove would be:

  HouseId TypeId
    1       2

How can I do that in Entity Framework 4 ?


house.Types.Remove(type)

or

type.Houses.Remove(house)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜