title: EF6 dynamically changing a Schema
body: <p>I have a database that contains an unknown number of schemas, each schema has the exact same tables.</p>
  
  <p>Is there anyway to change the schema at runtime when creating a new instance dbContext?  I know it's possible to change connection strings at runtime, however the schema names is stored in another database as a table of configurations.</p>
  
  <p>I saw that in EF6 you can set a defaultSchema when overriding <code>OnModelCreating</code> however I am not too sure if this is guaranteed to run everytime I use <code>using (DatabaseContext db = new DatabaseContext()){}</code></p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
      modelBuilder.HasDefaultSchema(SchemaName);
  }
  </code></pre>