Assuming there is an ASP.NET MVC application that uses Entity Framework 6 with code-first approach and StructureMap as IoC.
Also It uses Unit Of Work pattern.
Here are the c
public partial class YourDBContextClass
{
// Add a constructor to allow the connection string name to be changed
public YourDBContextClass(string connectionStringNameInConfig)
: base("name=" + connectionStringNameInConfig)
{
}
}
Add multiple connection strings to your web or app.config file.
in your program code:
YourDBContextClass dbcontext = new YourDBContextClass("alternateconnectionstringname");