Skip to main content

EF Core Tools

EF Core Tools provide dotnet ef CLI commands to manage migrations, update databases, and scaffold models from existing databases.

Install EF Core Tools

dotnet tool install --global dotnet-ef

Verify:

dotnet ef --version

Key Commands

# Create a new migration
dotnet ef migrations add InitialCreate

# Apply migrations to database
dotnet ef database update

# Remove last migration
dotnet ef migrations remove

# Scaffold models from existing DB
dotnet ef dbcontext scaffold "ConnectionString" Microsoft.EntityFrameworkCore.SqlServer

# List all migrations
dotnet ef migrations list

Coming Soon

Full walkthrough with examples coming soon!

nexcoding.in