title: Many to many relationship with junction table in Entity Framework?
body: <p>I'm trying to create a many-to-many relationship in Entity Framework (code first), according to the following post: <a href="https://stackoverflow.com/questions/5153849/database-design-for-limited-number-of-choices-in-mvc-and-entity-framework">Database design for limited number of choices in MVC and Entity Framework?</a></p>
  
  <p>However, I can't get it to work properly, and I'm sure I'm doing something very simple the wrong way. Here's the diagram I have no from my attempts:</p>
  
  <p><img src="https://i.stack.imgur.com/emMAx.jpg" alt="enter image description here"></p>
  
  <p>The point of the junction table is that I need to have an extra property, Level, in the relationship, so I can't just go with a direct relationship between Consultant and Program. I added the ConsultantProgramLink entity manually in the designer, and then added associations to Program and Consultant respectively, selecting to add a FK for each, and then made them both primary keys. But when I do it like this it doesn't work as I expected:</p>
  
  <p>If I had done a direct association between Consultant and Program, I would have been able to refer to, say, Consultant.Programs in my code. But that doesn't work now with the junction table. Is there any way to remedy this, or do I always have to go through the junction property (Consultant.ConsultantProgramLink.Programs)? In any case, even if I do try to go through the junction property it doesn't help. I can do Consultant.ConsultantProgramLink in my code, but another dot doesn't give me the navigation property Programs (which for some reason also became simply Program, why? Can I just rename them if I eventually get access to them at all?).</p>
  
  <p>So what am I doing wrong? Why can't I access the properties through dot notation in my code?</p>