Is there an easy way to scaffold migrations using old EF outside of Visual Studio? I would like to do it via Rider IDE if it possible.
-
You can run migrations with [migrate.exe](https://msdn.microsoft.com/en-us/library/jj618307(v=vs.113).aspx). Also, specify EF6 vs EF Core. – Steve Greene Jan 03 '18 at 22:28
4 Answers
I don't see these options related to ef core. The plugin makes sense.
(For MacOS, be sure, your dotnet root folder path is /usr/local/share/dotnet/
. I'm telling this because Rider installs and places it in another folder. Further it gives rise ef to not work properly. You can see your dotnet folder on terminal by writing which dotnet
)
Then,

- 18,731
- 3
- 79
- 101
For EF Core, you can use https://blog.jetbrains.com/dotnet/2017/08/09/running-entity-framework-core-commands-rider/
For EF 6 you may want to check https://blog.jetbrains.com/dotnet/2018/04/06/entity-framework-support-rider-2018-1/

- 3,344
- 18
- 31
-
But with `migrate.exe` for `EF 6` how can I make `update-database` or `add-migration`? – Dmitrij Polyanin Aug 02 '18 at 16:28
-
Check https://blog.jetbrains.com/dotnet/2018/04/06/entity-framework-support-rider-2018-1/ for EF6 – maartenba Sep 19 '18 at 11:37
The Package Manager Console tools such as Add-Migration
, Scaffold-DbContext
commands are PowerShell-based, and the Package Manager Console ties to several Visual Studio-specific objects making it impossible to host it elsewhere - in your case Rider.
In Rider's terminal or anywhere outside of Visual Studio, you can use CLI tools. Equivalents to the highlighted commands would be respectively:
Add-Migration
=>dotnet ef migrations add MigrationName
Scaffold-DbContext
=>dotnet ef dbcontext scaffold
You can get more details on JetBrains blog: Running EF Core commands in Rider

- 673
- 5
- 20