title: Change Entity framework database schema at runtime
body: <p>In most asp.net applications you can change the database store by modifing the connectionstring at runtime.  i.e I can change from using a test database to a production database  by simply changing the value of the "database" field in  the connectionstring</p>
  
  <p>I'm trying to change the schema (but not necessarily the database itself) with entity framework but no luck.</p>
  
  <p>The problem I'm seeing is the that the SSDL content in the edmx xml file is storing the <em>schema</em> for each entityset.</p>
  
  <p>see below</p>
  
  <pre><code>&lt;EntitySet 
      Name="task" 
      EntityType="hardModel.Store.task" 
      store:Type="Tables" 
      Schema="test"  /&gt;
  </code></pre>
  
  <p>Now I have changed the schema attribute value to "prod" from test and it works.. </p>
  
  <p>But this does not seem to be a good solution.</p>
  
  <ol>
  <li>I need to update evert entity set as well as stored procedures ( I have +50 tables )</li>
  <li>I can only do this an compile time?</li>
  <li>If I then try to later update the Entity model-entityies that already exist are being read due to EF not recognizing that the table already exists in the edm.</li>
  </ol>
  
  <p>Any thoughts?</p>