Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add-Migration or dotnet ef migrations add

From an architectural perspective:

  • How are these commands the same or different?
  • Which should be used when?
  • Which is better?
like image 232
JasonV.com Avatar asked Dec 23 '22 07:12

JasonV.com


1 Answers

Both the commands are used to add migrations and internally both works same and use EF Core Tools.

The only difference is that one is for PowerShell/Package Manager Console and another one is for Console, So you can run any of these two according to your requirement.

PowerShell

Add-Migration <MigrationName>

Console

dotnet ef migrations add <MigrationName>
like image 165
vivek nuna Avatar answered Dec 29 '22 05:12

vivek nuna