Back to Efcore

README

src/dotnet-ef/README.md

11.0.1004.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, dotnet-ef is for cross-platform command line tooling that can be used anywhere.

Usage

Install the tool package using:

dotnetcli
dotnet tool install --global dotnet-ef

The available commands are listed in the following table.

CommandUsage
dotnet ef --helpDisplays information about Entity Framework commands.
dotnet ef database dropDrops the database.
dotnet ef database updateUpdates the database to the last migration or to a specified migration
dotnet ef dbcontext infoGets information about a DbContext type.
dotnet ef dbcontext listLists available DbContext types.
dotnet ef dbcontext optimizeGenerates a compiled version of the model used by the DbContext.
dotnet ef dbcontext scaffoldGenerates a DbContext and entity type classes for a specified database.
dotnet ef dbcontext scriptGenerates a SQL script from the DbContext. Bypasses any migrations.
dotnet ef migrations addAdds a new migration.
dotnet ef migrations bundleCreates an executable to update the database.
dotnet ef migrations has-pending-model-changesChecks if any changes have been made to the model since the last migration.
dotnet ef migrations listLists available migrations.
dotnet ef migrations removeRemoves the last migration.
dotnet ef migrations scriptGenerates a SQL script from the migrations.

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.