Reputation: 2299
I am trying to add initial migration using EF Core. I am not sure which one to use OR when I should be using the below. I am using EF core 1.1
dotnet ef migration add init
(using window console)
OR
add-migration init
(using Nuget Console)
I have been using Nuget Package Manager Console in the past (EF 6) for migration.
I also noticed that both are being used for EF Core but I am not sure for which .NET framework (.NET Core) version the above commands are valid.
regards, Alan
Upvotes: 2
Views: 1200
Reputation: 30405
As Martin said, you can use either. The dotnet ef
command even works in PMC if you cd
to the project first. There is even a third command: ef.exe
that can be found in the NuGet package.
Here is an explanation of what each one gives you: (in "ascending" order)
*.csproj
files (using MSBuild). Infers project info. Calls ef.exe
ef.exe
So, to get the best experience, use the PMC Tools (i.e. Add-Migration
, etc.) if you can.
Upvotes: 6
Reputation: 168
You can use either.
Personally, I like to use the NuGet console, as I dont have to leave Visual Studio. The PowerShell commands from NuGet console simple run the dotnet.exe commands under the hood anyway - They are just syntactic sugar :)
Upvotes: 2