← .NET Core learning path.NET Core · Module 7 of 10
Entity Framework Core
Access databases with EF Core.
📖 Key ideas
- DbContext represents a database session; DbSet<T> represents tables.
- Code-first: classes become tables via migrations.
- dotnet ef migrations add Init; dotnet ef database update.
- LINQ queries translate to SQL: db.Products.Where(p => p.Price > 100).
- Providers: SQL Server, PostgreSQL, SQLite, MySQL.
💡 Real-life example: EF Core is a translator converting your C# questions into SQL the database understands.
DbContextSession with the database
DbSetTable collection
MigrationSchema change script
ProviderDatabase-specific adapter