What problem does it solve?
This Skill helps you implement Entity Framework Core in a way that avoids common performance traps and correctness issues, so your .NET app queries, migrations, and bulk operations stay efficient as your schema and codebase grow.
Core Features & Use Cases
- DbContext configuration with discoverable entity mappings: Use
IEntityTypeConfiguration<T> and ApplyConfigurationsFromAssembly to keep model configuration maintainable.
- Query optimization that prevents over-fetching and N+1: Prefer projections via
.Select() and avoid loading unnecessary data.
- Production-grade database workflows: Review and apply migrations like code, generate idempotent SQL scripts for production, and use global query filters for soft deletes and multi-tenancy.
- Performance primitives for hot paths: Use
ExecuteUpdateAsync/ExecuteDeleteAsync for bulk operations, SaveChangesInterceptor for audit/soft-delete cross-cutting concerns, and compiled queries for frequently repeated query shapes.
- Data modeling improvements: Apply value converters (e.g., enums as strings, strongly-typed IDs) and use precision/constraints intentionally.
Quick Start
When you are working on an EF Core task, ask the assistant to generate or refactor your DbContext configuration and the specific query (including projections, pagination, and any needed interceptors or bulk operations) to match modern .NET 10 practices.