Mid EF Core

How does Code First handle schema changes in the database?

EF Core uses migrations to track and apply schema changes:

  • You modify your C# models.
  • Use Add-Migration to create a migration class.
  • Use Update-Database to apply the changes to the DB.

EF Core compares the model to the current schema to generate SQL.

More from Entity Framework Core Tutorial

All questions for this course