How do I remove many to many link between 2 EF Ojects [closed]
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.
精彩评论