What problem does it solve?
Many EF Core queries accidentally load too much data, perform extra database round-trips, or create N+1 performance problems; this Skill focuses on patterns that make queries efficient, safe, and scalable for .NET applications.
Core Features & Use Cases
- Read-only performance: Apply AsNoTracking and projection to return only the columns needed for UI or APIs.
- N+1 prevention: Use split queries or appropriate includes to avoid cartesian explosion when loading related collections.
- Hot-path optimization: Compile frequently used queries for reuse and high throughput, and use pagination and batch operations to control result size.
- Raw SQL & bulk work: Employ parameterized raw SQL and ExecuteUpdateAsync/ExecuteDeleteAsync for complex aggregations or bulk changes.
- Use Case: Replace full entity loads in list endpoints with Select projections and paginated responses, compile detail lookups for hot endpoints, and convert load-and-update loops to ExecuteUpdateAsync for archival jobs.
Quick Start
Optimize this query to use AsNoTracking, project results to a DTO with Select, apply pagination, and add AsSplitQuery where multiple Includes cause N+1 issues.