Open Caedendi opened 4 years ago
I wonder why the author uses dotnet ef ...
Microsoft documents often use add-migration AddItems
Does any one know their results' differences?
@LeiYangGH dotnet ef
and Add-Migration
do the same thing. The first is a global tool that can be installed on any operating system and run from the terminal. The second is a tool specific to a feature in Visual Studio on Windows called Package Manager Console. You can use either approach and the result will be the same.
The official EF Core docs let you switch between the styles. For example, https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli#create-your-first-migration
@LeiYangGH
dotnet ef
andAdd-Migration
do the same thing. The first is a global tool that can be installed on any operating system and run from the terminal. The second is a tool specific to a feature in Visual Studio on Windows called Package Manager Console. You can use either approach and the result will be the same.The official EF Core docs let you switch between the styles. For example, https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli#create-your-first-migration
Got it, thanks!
I'm on page 53, which tells the reader to run the console command
dotnet ef migrations add AddItems
This ends up in an error because dotnet-ef is no longer included in the .NET Core 3 SDK and requires an explicit install before it can be used:
dotnet tool install --global dotnet-ef
The error was easy to solve and i found the answer here.
Still, this should be updated and im posting this issue for anyone who runs into this in the future.