开发者

How do I remove many to many link between 2 EF Ojects [closed]

It's 开发者_如何学Godifficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

I have a Many to many relationship in my EF. I want to remove the link between 2 of the objects but leave the rest of the relationships intact.

Is there a way to do this with out using a stored procedure or executeStoreQuery?


What exactly is the problem? If you have two objects related in many-to-many relationship both have collection navigation property so removing is done by:

entityA.RelatedEntities.Remove(entityB);

Where entityA is your first object RelatedEntities is collection of related objects and entityB is the object you want to remove from relation.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜