Hello, good morning!
I have a project where there are two scenarios, which is homologation and production. In this same project I created two connectionstrings
, setting one for each scenario.
In the system these scenarios are divided into subdomains, such as homolog.domain.com and the domain.com itself.
Now comes the question:
Is there a way to create a setting for connectionstring
to fit the scenario? When I access the homolog it automatically picks up the% of the homologation.
You're like this:
<connectionStrings>
<add name="connectionstring_homolog" providerName="System.Data.SqlClient" connectionString="Data Source=xxxx;Initial Catalog=xxxxxx; User ID=xxxxxx; pwd=xxxxxxx;" />
<add name="connectionstring_prod" providerName="System.Data.SqlClient" connectionString="Data Source=xxxxxx;Initial Catalog=xxxxxx; User ID=xxxx; pwd=xxxxx;" />
</connectionStrings>
Remembering that I'm using ASP.Net MVC.
Thank you in advance.