title: Getting 'Context is not constructible. Add a default constructor or provide an implementation of IDbContextFactory."
body: <p>I am getting this error when I try to use code first migrations.</p>
  
  <p>My context has a constructor with the connection name.</p>
  
  <pre><code>public class VeraContext : DbContext, IDbContext
  {
      public VeraContext(string NameOrConnectionStringName = "VeraDB")
          : base(NameOrConnectionStringName)
      {
      }
  
      public IDbSet&lt;User&gt; Users { get; set; }
      public IDbSet&lt;Product&gt; Products { get; set; }
      public IDbSet&lt;IntCat&gt; IntCats { get; set; }
  }
  </code></pre>
  
  <p>This connection name is injected with ninject when the project runs, I have also specified it as a default as in the above code but this did not help.</p>
  
  <pre><code>kernel.Bind&lt;IDbContext&gt;()
      .To&lt;VeraContext&gt;()
      .WithConstructorArgument("NameOrConnectionStringName", "VeraDB");
  </code></pre>
  
  <p>When I try to add migrations with "Enable-Migrations" is throws up the error:</p>
  
  <blockquote>
    <p>The target context 'VeraData.EF.Infrastructure.VeraContext' is not
    constructible. Add a default constructor or provide an implementation
    of IDbContextFactory.</p>
  </blockquote>
  
  <p>If I remove the constructor from <code>VeraContext</code> it will work but creates another database with <code>VeraData.EF.Infrastructure.VeraContext</code> as its name.</p>
  
  <p>I presume that <code>ninject</code> only passes the connection string when the project runs and not when I use code first migrations. Anyway I can inject/provide a default for the connection name when using code first migrations ?</p>