Insert/Update Many to Many Entity Framework . How do I do it?

I'm using EF4 and new to it. I have a many to many in my project and cannot seem to work out how to insert or update. I have build a small project just to see how it should be coded.

Suppose I have 3 tables

  1. Class : ClassID-ClassName
  2. Student : StudentID-FirstName-Surname
  3. StudentClass : StudentID-ClassID

After adding all the relationship and updated the model via model browser I have noticed that StudentClass does not appear, this seems to be default behaviour.

Now I need to do both an Insert and Update. How do you do it? Any code samples or link where I can download an example, or can you spare 5 mins?

101
задан abatishchev 4 March 2016 в 08:05
поделиться