Entity Framework + Many-To-Many Inserts + WCF Class Library

Answered Entity Framework + Many-To-Many Inserts + WCF Class Library

  • Friday, June 17, 2011 5:28 PM
     
     

    EF does not include the junction table in the model when representing many-to-many relationships. I understand the logic behind this as objects can do this relationship thus; ObjectA can have a collection of ObjectB and vice versa whereas databases cannot. My example is:

    Entity called EBR and Entity called Warning (in the databas the junction table is EBRWarning).

    I can't figure out how to insert a record into the juction table. In the client-side intellisense, neither object has a property of the other.

    The junction table itself is available i.e. EBRWarning exists as an object but there is no 'Context.Add' method as thre is for other tables that I marked as Editable.

All Replies