title: Changing the Database Schema on a linking table (many-to-many) in EF
body: <p>I am creating a many to many relationships with my EF Models.  The linking table is being created which is fine, but it keeps putting it on the DBO Schema which I do not want.  Yes, I could just modify the migration script after its generated but that should be (hoping there is) a way to do this so the schema just works.</p>
  
  <p>From my OnModelCreating Method:</p>
  
  <pre><code>modelBuilder.Entity&lt;AppUser&gt;()
              .HasMany(x =&gt; x.Addresses)
              .WithMany(x =&gt; x.Users)
              .Map(x =&gt; {
                  x.ToTable("Users.UsersAddresses");
                  x.MapLeftKey("UserId");
                  x.MapRightKey("AddressId");
              });
  </code></pre>
  
  <p>From the Generated Script:</p>
  
  <pre><code>CreateTable(
      "dbo.[Users.UsersAddresses]",
      c =&gt; new
          {
              UserId = c.String(nullable: false, maxLength: 128),
              AddressId = c.Long(nullable: false),
          })
      .PrimaryKey(t =&gt; new { t.UserId, t.AddressId })
      .ForeignKey("Users.Users", t =&gt; t.UserId, cascadeDelete: true)
      .ForeignKey("Users.Addresses", t =&gt; t.AddressId, cascadeDelete: true)
      .Index(t =&gt; t.UserId)
      .Index(t =&gt; t.AddressId);
  </code></pre>