title: Not sure how to map many to many relationship - Reuse mapping table different entities
body: <p>I'm confused with mapping the following relationship.</p>
  
  <p>I have the following three relevant entities: <code>User</code>, <code>Group</code>, <code>GroupUser</code>.</p>
  
  <p><code>User</code> has information about a user account, a <code>group</code> information about the group, and <code>GroupUser</code> contains information about the user's membership in the group.</p>
  
  <pre><code>public class User
  {
      List&lt;GroupUser&gt; Groups { get; set; }
  }
  
  public class Group
  {
      List&lt;GroupUser&gt; Users { get; set; }
  }
  
  public class GroupUser
  {
      Group Group { get; set; }
      User User { get; set; }
      string Position { get; set; }
      DateTime Joined { get; set; }
  }
  </code></pre>
  
  <p>I created a one sided mapping with the following in the <code>User</code> group:</p>
  
  <pre><code>        HasMany(x =&gt; x.Groups)
          .WithMany()
          .Map(m =&gt;
          {
              m.ToTable("UserGroups");
              m.MapLeftKey("UserId");
              m.MapRightKey("GroupId");
          });
  </code></pre>
  
  <p>However, when I try and map it again in <code>Group</code></p>
  
  <pre><code>        HasMany(x =&gt; x.Users)
          .WithMany()
          .Map(m =&gt;
          {
              m.ToTable("UserGroups");
              m.MapLeftKey("GroupId");
              m.MapRightKey("UserId");
          });
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Schema specified is not valid. Errors: 
  (274,6) : error 0019: The EntitySet 'UserUserGroup' with schema 'dbo' and table 'UserGroups' was already defined. Each EntitySet must refer to a unique schema and table.
  </code></pre>
  
  <p>I want to reuse the mapping table between both entities, how can I do this?</p>