How to change connection string on command line to update database on migration to a new database in Entity Framework Core

asp.net-core c# entity-framework-core multi-tenant

Question

In ASP.NET Core and EF Core Code First, I have a multi-tenant webapp. When I create a new tenant, I want to change connection string, add migration on it and then update.

From command line, add migration can't get connection string dinamically on tenant and so i haven't a valid connection string for create a new database in the first time the app starts with a new tenant. Is there any solution for it? Thanks

1
6
8/18/2016 8:11:30 AM

Popular Answer

Are you looking for this? Edit: this is for EF 6.1

Update-Database –ConnectionString "Data Source=YourDatabaseServer; Initial Catalog=YourDatabase; Integrated Security=True;"
2
9/26/2017 1:19:40 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow