User-959394753 posted
Hi
For a long time I have been struggling with the problem that with EF migrations my Update-database command fails with the message : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was
not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
reading https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell I see that if there are multiple DBContext
classes in your project the -Context<string> syntax should be used.
since I have two database context classes in my Data folder ie. ApplicationDbContect.cs and RoosterContectFactory.cs I havebeen trying :
PM> update-database -Context ApplicationDbContext.cs ,
PM> update-database -Context Data/ApplicationDbContext.cs and
PM> update-database -Context data/ApplicationDbContext
but every time with a failing message No DbContext named 'data/ApplicationDbContext' was found.
what is the right syntax for this command?
thanks
Rob