Hi Koen,
We have created a workaround that might help you as well.
On your Custom DbContext:
public class GlobalDBContext : DbContext
{
public GlobalDBContext() :
base(Web.GetLatestMigrationConnection("MyEntities") ?? "name=MyEntities")
{
}
}
Just add a method call on the base Constructor parameter that compose your connection string on runtime.
Note that when you're creating migration script via Package Manager Console (Add-Migration 'Something') you need to comment out this base(Web.GetLatestMigrationConnection("MyEntities") ?? "name=MyEntities")
and replace it with a basic base("name=MyEntities") that gets connection string from your app.config.
The code that I gave you above only works on production runtime. :)
Thanks,
Von