Back to Efcore

README

src/EFCore.Tools/README.md

11.0.1003.5 KB
Original Source

The 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).

Usage

Install the tools package by running the following in the Visual Studio PMC:

powershell
Install-Package Microsoft.EntityFrameworkCore.Tools

The available commands are listed in the following table.

PMC CommandUsage
Add-MigrationAdds a new migration.
Bundle-MigrationCreates an executable to update the database.
Drop-DatabaseDrops the database.
Get-DbContextGets information about a DbContext type.
Get-Help EntityFrameworkDisplays information about Entity Framework commands.
Get-MigrationLists available migrations.
Optimize-DbContextGenerates a compiled version of the model used by the DbContext.
Remove-MigrationRemoves the last migration.
Scaffold-DbContextGenerates a DbContext and entity type classes for a specified database.
Script-DbContextGenerates a SQL script from the DbContext. Bypasses any migrations.
Script-MigrationGenerates a SQL script from the migrations.
Update-DatabaseUpdates the database to the last migration or to a specified migration.

Getting started with EF Core

See Getting started with EF Core for more information about EF NuGet packages, including which to install when getting started.

Feedback

If you encounter a bug or issues with this package,you can open an Github issue. For more details, see getting support.