Ef
Getting Started
dotnet tool install --global dotnet-ef
dotnet tool update --global dotnet-ef
dotnet tool update dotnet-ef
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet ef database drop dotnet ef database update dotnet ef dbcontext info
Compile models:
dotnet ef dbcontext optimize
dotnet ef dbcontext scaffold
dotnet ef migrations add Initial -o Migrations -n Data.Migrations
–namespace | -n Namespace –output | -o Output directory / file
dotnet ef migrations bundle
dotnet ef migrations has-pending-model-changes dotnet ef migrations list dotnet ef migrations remove
dotnet ef dbcontext script -o output.sql
Options
Option Short Description
–json Show JSON output.
–context