title: Passing string into a Constructor of DbContext with a Base class is not setting the value
body: <p>I have decide out of a business need to make a change to my <code>DbContext</code> class</p>
  
  <p>Previously my code looked like this:</p>
  
  <pre><code>public class RPMContext : DbContext
  {
      public RPMContext() : base(ConnectionString()) { }
  
      private static string ConnectionString(string connection)
      {
          conn = ConfigurationManager.ConnectionStrings["LH_RPMContext"].ConnectionString;
          return conn;
      }
  }
  </code></pre>
  
  <p>Above "Works"  but I need to be able to PASS in a string in which I'm able to set the <strong>static</strong> method <strong>ConnectionString</strong> to OTHER specified connection strings</p>
  
  <p>So Thus <strong>my NEW code</strong> started down a path of NOT use <strong>base</strong> </p>
  
  <pre><code>public class RPMContext : DbContext
  {
  
      public RPMContext(string environment)
      {
          ConnectionString(environment);
      }  
  
      private static string ConnectionString(string connection)
      {
  
          string conn;
  
          if (connection == "LH")
          {
              conn = ConfigurationManager.ConnectionStrings["LH_RPMContext"].ConnectionString;
          }
          else 
          {
            // dev , qa  etc..
          }
  
          return conn;
      }
  
  
  }
  </code></pre>
  
  <p><strong>PROBLEMS</strong></p>
  
  <p>I suppose this are several issue in which I'm not understanding that </p>
  
  <ol>
  <li>I need to be "setting the <code>DbContext</code> in which the <code>base</code> does that?</li>
  <li>Do I NEED <code>base</code>  for what I am doing?</li>
  <li>Would <code>:this()</code>  be of benefit?</li>
  </ol>
  
  <p>Previously I would instantiate with <code>private RPMContext db = new RPMContext();</code></p>
  
  <p>Now   <code>RPMContext("LH")</code>  and whatever string I wish /want to use.</p>
  
  <p>Obviously with the current code, I'm getting "use of unassigned local variable conn"   </p>