How to choose DbConfigurationType programmatically?
<p>I have a <code>DbContext</code>:</p>

<pre><code>[DbConfigurationType(typeof(MySqlEFConfiguration))]
public class MyDbContext : DbContext
{
    public DbSet&lt;MyClass&gt; MyClasses { get; set; }
}
</code></pre>

<p>Now, what if I want to be able to use another <code>DbConfigurationType</code>, according to AppSettings value?</p>

<p>So that, I change AppSettings value from <code>MySQL</code> to <code>MSSQL</code> and it becomes:</p>

<pre><code>[DbConfigurationType(typeof(MsSqlEFConfiguration))]
public class MyDbContext : DbContext
{
    public DbSet&lt;MyClass&gt; MyClasses { get; set; }
}
</code></pre>

<p>Of course, I can create a factory, and use reflection to create a new class with custom attribute. However, is there a solution without reflection?</p>