Entity Framework Core Tools for the NuGet Package Manager Console in Visual Studio. Enables these commonly used commands: Add-Migration Bundle-Migration Drop-Database Get-DbContext Get-Migration Optimize-DbContext Remove-Migration Scaffold-DbContext Script-Migration Update-Database
$ dotnet add package Microsoft.EntityFrameworkCore.ToolsThe Entity Framework Core tools help with design-time development tasks. They're primarily used to manage Migrations and to scaffold a DbContext and entity types by reverse engineering the schema of a database.
This package, Microsoft.EntityFrameworkCore.Tools is for PowerShell tooling that works in the Visual Studio Package Manager Console (PMC).
Install the tools package by running the following in the Visual Studio PMC:
Install-Package Microsoft.EntityFrameworkCore.Tools
The available commands are listed in the following table.
| PMC Command | Usage |
|---|---|
| Add-Migration | Adds a new migration. |
| Bundle-Migration | Creates an executable to update the database. |
| Drop-Database | Drops the database. |
| Get-DbContext | Gets information about a DbContext type. |
| Get-Help EntityFramework | Displays information about Entity Framework commands. |
| Get-Migration | Lists available migrations. |
| Optimize-DbContext | Generates a compiled version of the model used by the DbContext. |
| Remove-Migration | Removes the last migration. |
| Scaffold-DbContext |
Generates a DbContext and entity type classes for a specified database. |
| Script-DbContext | Generates a SQL script from the DbContext. Bypasses any migrations. |
| Script-Migration | Generates a SQL script from the migrations. |
| Update-Database | Updates the database to the last migration or to a specified migration. |
See Getting started with EF Core for more information about EF NuGet packages, including which to install when getting started.
If you encounter a bug or issues with this package,you can open an Github issue. For more details, see getting support.