What problem does it solve?
This Skill helps you build reliable, high-performance data access with Entity Framework Core by preventing common pitfalls that lead to slow queries, excessive loading, and fragile migrations.
Core Features & Use Cases
- DbContext configuration patterns: Use
IEntityTypeConfiguration<T> and ApplyConfigurationsFromAssembly to keep mappings maintainable and discoverable.
- Production-ready query design: Prefer projections (
Select to DTOs) to avoid over-fetching and N+1 problems, plus pagination patterns for scalable list endpoints.
- Performance and correctness tools: Use
ExecuteUpdateAsync/ExecuteDeleteAsync, interceptors for audit/soft-delete concerns, compiled queries for hot paths, value converters for strongly-typed IDs/enums, and global query filters to enforce invariants.
- Migrations workflow guidance: Treat migrations as code—review before applying, test, and generate idempotent SQL for production instead of auto-migrating.
Use Case Example: You are building a sales/reporting screen for a POS system and need a list of orders with item summaries without loading full entities or suffering N+1 queries; you also want bulk status updates and safe schema changes across environments.
Quick Start
Ask the AI to show an EF Core DbContext setup with IEntityTypeConfiguration, then write a projected LINQ query with pagination that avoids N+1 and prepares a migration command workflow.