Using .NET Core CLI for Entity framework migrations

You can refer to full list of commands here. Documenting this for my own reference especially as my mind goes blank sometimes.

Right-click on the project and Open Command line

// Add migration┬ánamed ‘InitialDatabase’
dotnet ef migrations add InitialDatabase

// remove migrations
dotnet ef migrations remove

// Update database
dotnet ef database update

Yeah it is quite easy.

Leave a comment