What problem does it solve?
This Skill unit helps .NET developers optimize their Entity Framework Core (EF Core) database operations, addressing common issues with query performance, migration management, and change tracking.
Core Features & Use Cases
- NoTracking by Default: Enhance performance by disabling change tracking for most queries.
- Migration Management: Leverage EF Core CLI commands to manage database migrations efficiently.
- Dedicated Migration Service: Ensure migrations are executed separately from the main application, improving separation of concerns.
- ExecutionStrategy for Retries: Handle transient database failures gracefully.
- Explicit Updates: Properly manage entities for update when NoTracking is used.
- Bulk Operations: Execute efficient bulk updates and deletes to improve performance.
- Prevent N+1 Queries: Avoid performance issues with eager loading.
- DbContext Lifetime: Manage DbContext lifecycle for different scenarios, such as scoped by default in ASP.NET Core or using a factory pattern for long-lived objects.
Quick Start
Use the efcore-patterns skill to configure your DbContext for NoTracking and manage database migrations with the EF Core CLI.