Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>In short:</strong> This relationship type between <code>Student</code> and <code>Class</code> is called <strong>many to many relationship</strong> in EF terminology.</p> <blockquote> <p>Entity framework handles tables participating in Many to Many relationship in a nice manner. If the junction table (sometimes called bridge table, association table, link table, etc) only consists of the foreign keys and no other columns, then that table is abstracted by EF and the two sides get a navigational property exposing a collection of the other side.</p> </blockquote> <p>What you would need is to generate a Entity Model for the above tables first or define your code first structure like in the following post - <a href="http://www.codeproject.com/Articles/234606/Creating-a-Many-To-Many-Mapping-Using-Code-First" rel="noreferrer">Creating a Many To Many Mapping Using Code First</a>.</p> <p>Basically, depending on your structure you need to set the method <code>OnModelCreating</code> appropriate to the relationships in your classes.</p> <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder) </code></pre> <p>Depending on your <strong>query needs</strong> you will find it informative to look at the following references:</p> <ul> <li><a href="http://smehrozalam.wordpress.com/2010/06/29/entity-framework-queries-involving-many-to-many-relationship-tables/" rel="noreferrer">Queries involving many to many relationship tables</a></li> <li><a href="http://weblogs.asp.net/zeeshanhirani/archive/2008/08/21/many-to-many-mappings-in-entity-framework.aspx" rel="noreferrer">Many To Many Mappings in Entity Framework</a></li> <li><a href="http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/db6df279-a925-443c-a616-7375867409a6/" rel="noreferrer">Many-to-Many Relationships with Entity Framework</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload