What are migrations?
How are they used in Code First?
Migrations in EF Core are a way to:
- Track schema changes over time
- Apply those changes to the database
📦 Basic commands:
- Add-Migration MigrationName
- Update-Database
- Remove-Migration
- Script-Migration
🔄 Migrations are classes containing Up() and Down() methods (for applying and reverting
changes).
📌 They are essential for schema versioning in Code First.
Entity Framework Core – Migrations
Interview Questions