I'm using Entity Frameowrk Core to handle different database in a .NET Core 3.0 WPF application. I'm using different SQLite DB files for different users, so the connection string change for every user that log in.
I have to be able to use migrations, but when i run dotnet ef migrations add V2
for example, it fail because it cannot find the DB.
How can I generate migrations in this situation?
This is my code for the context:
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
var connectionString = string.Format("Data Source={0}", GetDbPath(this.username));
this.connection = new SqliteConnection(connectionString);
this.connection.Open();
options.UseSqlite(this.connection)
}