title: Support multiple database using Entity Framework 6.0 with connection string transforms
body: <p>I've a Web API project which uses EF 6.0 for database operations. I have 3 different Azure SQL databases (Dev, Test, Prod). </p>
  
  <p>I have been able to create an Entity Data Model with data first approach. </p>
  
  <p>I've used configuration manager of VS2017 to create a web.test config file, but transformation of connection strings isn't working. </p>
  
  <p>Currently my <code>web.config</code> file has the connection string that points to Dev environment as follows:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="ProjectDbEntity" 
           connectionString="metadata=res://*/Data.ProjectEntityModel.csdl|res://*/Data.ProjectEntityModel.ssdl|res://*/Data.ProjectEntityModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=company-ai-Projectserver.database.windows.net;initial catalog=company.DB_Dev;persist security info=True;user id=Project;password=Password1234$$;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;" 
           providerName="System.Data.EntityClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>And, <code>web.test.config</code> is as follows:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="ProjectDbEntity" 
           connectionString="metadata=res://*/Data.ProjectEntityModel.csdl|res://*/Data.ProjectEntityModel.ssdl|res://*/Data.ProjectEntityModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=company-ai-Projectserver.database.windows.net;initial catalog=company.DB_Test;persist security info=True;user id=Project;password=Project1234$$;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;" 
           providerName="System.Data.EntityClient" 
           xdt:Transform="SetAttributes"
           xdt:Locator="Match(name)"/&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I'm not able to figure out how do I make EF change connection string, when I'm using it to build a EF model using one instance of database, but during deployment I want to use other database instances with the same schema. </p>
  
  <p>I've been reading up on the following <a href="http://olivierhelin.com/blog/entity-framework/entity-framework-6-one-entity-data-model-multiple-databases-2" rel="nofollow noreferrer">post</a>, but somehow not able to make it work.</p>
  
  <p><strong>EDIT</strong>: I found the solution. All I had to do is select Publish option, then Settings and again select Settings on the popup, and finally select the configuration from the drop down option to the desired configuration. It seems selecting the configuration on the main menu does not publishes the same environment unless explicitly selected.</p>