Tuesday, January 2, 2018

More than one DbContext was found while updating sql database in EF

While updating my sql database after adding migration I have got error from console like below:
More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.
because I have two dbcontext in my project. so here is the solution for it if someone face such problem:
Update-Database -Context MyContext1