title: Ninject - binding constructors with arguments / Entity Framework connection string
body: <p>Please forgive my ignorance, but I am very new to IOC and NinJect. I have searched for high and low for easily understandable solutions but so far they have eluded me.</p>
  
  <p>So far I have the following and all works as expected:</p>
  
  <pre><code>private class StandardModule : NinjectModule
      {
        public override void Load()
        {
          Bind&lt;ILog&gt;().To&lt;NLogLogger&gt;();    // Use NLog
          Bind&lt;IMyEntityFrameWorkRepository().To&lt;MyEntityFrameWorkRepository&gt;();
        }
      }
  </code></pre>
  
  <p>MyEntityFrameWorkRepository then creates its own EF DbContext via a connection string declared in app/web.config:</p>
  
  <pre><code>public class MyDbContext : DbContext
  {
     public MyDbContext() : base("MyAppConfig")
     {
     }
     ........
  }
  </code></pre>
  
  <p>HOWEVER!!  My goal is something like this - I realise this syntax is "nonsense" (and I <em>think</em> I may have to IOC MyDbConext too) , but I hope the "pseudo-code"  conveys my desire:</p>
  
  <pre><code>private class StandardModule : NinjectModule
  {
    public override void Load()
    {
      Bind&lt;ILog&gt;().To&lt;NLogLogger&gt;();    // Use NLog
  
      string mySqlConnectionString = MyApp.GetCommandLineArgument("sqlconn"); // "Data Source=..."
      Bind&lt;IMyEntityFrameWorkRepository().To&lt;MyEntityFrameWorkRepository&gt;(mySqlConnectionString);
    }
  }
  
  .................
  
  public class MyDbContext : DbContext
  {
     public MyDbContext( string sqlConnectionString) :
        base(sqlConnectionString) // will accept a standard SQL connection string
     {
     }
     ........
  }
  </code></pre>
  
  <p>I would truly appreciate some feedback from IOC / NinJect experts, since I am sure any "pattern" can be very useful in other scenarios.</p>