ef-core

Installation
SKILL.md

EF Core (.NET 10)

Targets EF Core 10 (LTS, supported until 2028-11-10). New-in-10 details, SQL output and the EF Core 11 note live in references/ef-core-10.md.

Core Principles

  1. EF Core is the default ORM — Use it unless you have a specific reason not to (extreme perf, legacy DB without FK constraints). See ADR-003.
  2. DbContext is a unit of work — Don't wrap it in another UoW or repository. It already is one.
  3. Reads are projections — .Select() into DTOs. No tracking, no over-fetching, no N+1. If you must return entities from a read, add AsNoTracking().
  4. Writes are tracked entities or bulk ExecuteUpdate/ExecuteDelete — Never load rows just to change one column.
  5. Migrations are code — Review them, test them, never auto-apply in production.

Patterns

DbContext Configuration

Use IEntityTypeConfiguration<T> per entity; keep the context thin.

Installs
4.2K
GitHub Stars
853
First Seen
Mar 13, 2026