Entity Framework how to do many to many save and update

  • Thread starter Thread starter khp1412
  • Start date Start date
K

khp1412

Hi

I have a datamodel :

Plan - Plan_Section - Section - Section_Question - Question -
Question_Answer - Answer - Answer_AnswerField - AnswerField

The problem is :

If i retrieve an existing plan with a complete set of child objects and
relations. Then add a mixture of new and existing objects to the plan, i.e.,
I add a new section containing two existing questions, one of which includes
a new answer.

section A(new) - question A(existing)
section A(new) - question B(existing) - answer A(new)

My understanding is that i need to add/create answer A and savecontext,
before i can add the relation between question B and answer A.

Is this correct, can someone direct me to some examples of creating/updating
many-to-many in the entity framework. Not just the usual, heres how you
retrieve many to many, or heres how you insert a complete new object graph.
This is all clear to me.

The problem is the lack of information about doing complex updates with a
mixture of new and existing objects in a large graph with many-to-many
relations.
 
Back
Top