What problem does it solve?
EF Core patterns address how to maximize data access performance, maintain clean migrations, and enforce safe change-tracking practices across multi-project solutions, reducing boilerplate and deployment risk.
Core Features & Use Cases
- NoTracking by default to improve read performance, with explicit tracking required for updates.
- Never edit migrations manually: rely on EF Core CLI commands to manage migrations and avoid direct edits.
- Dedicated Migration Service with Aspire: separate migrations and seeding from app startup to ensure stable deployments.
- ExecutionStrategy for transient failures: use CreateExecutionStrategy for robust retry logic around database operations.
- Bulk operations with ExecuteUpdate/ExecuteDelete: perform updates and deletes in SQL without loading entities.
- Query splitting for navigation properties: configure global split behavior to avoid cartesian explosion and improve load performance.
- Testing guidance: use InMemory for unit tests and containerized databases for integration tests.
Quick Start
Configure your DbContext with NoTracking by default, set up a dedicated migration service, enable query splitting, and follow migration CLI guidelines to keep migrations consistent.