Entity Framework Core guidance covering NoTracking defaults, query splitting, migration handling, and a dedicated migration service.

skills.sh installs
1.6K
GitHub stars
1.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers NoTracking by default, explicit tracking and update rules, query splitting for navigation collections, and migration management with Aspire
  • Includes dotnet ef commands for adding, removing, applying, and scripting migrations, plus a dedicated MigrationService project
  • Enforces CLI-only migration changes, so migration files are never edited, deleted, renamed, or copied by hand
  • Designed for .NET teams using EF Core with .NET Aspire who need read-heavy query performance and controlled schema updates

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill efcore-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Entity Framework Core Patterns

When to Use This Skill

Use this skill when:

  • Setting up EF Core in a new project
  • Optimizing query performance
  • Managing database migrations
  • Integrating EF Core with .NET Aspire
  • Debugging change tracking issues
  • Loading multiple navigation collections efficiently (query splitting)

Core Principles

  1. NoTracking by Default - Most queries are read-only; opt-in to tracking
  2. Never Edit Migrations Manually - Always use CLI commands
  3. Dedicated Migration Service - Separate migration execution from application startup
  4. ExecutionStrategy for Retries - Handle transient database failures
  5. Explicit Updates - When NoTracking, explicitly mark entities for update

Pattern 1: NoTracking by Default

Configure your DbContext to disable change tracking by default. This improves performance for read-heavy workloads.

Details

Repository
github.com/aaronontheweb/dotnet-skills
Categories
.NET & C#, Databases

More from aaronontheweb/dotnet-skills

All 34

Similar to Efcore Patterns

More .NET & C#