Reputation: 37
is there any way to change the ConnectionString
property that has application as scope at runtime?
Upvotes: 1
Views: 101
Reputation: 5861
In this link you can use an connection string for each request. Just Change the IUserService
to IConnectionStringService
public interface IConnectionStringService
{
string GetConnectionString();
}
public class ConnectionStringService : IConnectionStringService
{
public string GetConnectionString()
{
//read connection string from appSetting.json or anything
return "";
}
}
Upvotes: 2