ef-core

Implement Entity Framework Core patterns for .NET database queries and migrations.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/Maj3D10/Training-Platform --skill ef-core-maj3d10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ef-core
Source: https://github.com/Maj3D10/Training-Platform/tree/main/.agent/skills/ef-core
Command: npx skills add https://github.com/Maj3D10/Training-Platform --skill ef-core-maj3d10

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you implement reliable, high-performance Entity Framework Core data access patterns so your queries, migrations, and bulk operations stay maintainable and efficient.

Core Features & Use Cases

  • DbContext configuration: Organize entity mapping with IEntityTypeConfiguration and ApplyConfigurationsFromAssembly for clean, discoverable models.
  • Safe query design: Use projections (Select into DTOs) to avoid over-fetching and reduce N+1 query problems, with guidance for pagination and query shaping.
  • Production-ready persistence operations: Apply migrations as code, use bulk ExecuteUpdateAsync/ExecuteDeleteAsync for performance, add SaveChangesInterceptor for cross-cutting concerns, and leverage compiled queries and value converters.
  • Common anti-pattern avoidance: Prevent lazy loading pitfalls, in-memory filtering mistakes, and fire-and-forget async bugs.

Quick Start

Use the ef-core skill to design a DbContext and write projection-based LINQ queries with EF Core and an explicit migrations workflow for a .NET 10 application.

Frequently Asked Questions about ef-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Entity Framework Core queries to avoid N+1 problems?

To avoid N+1 problems in Entity Framework Core, use projection-based querying with Select to fetch only needed DTO fields, preventing over-fetching and reducing unnecessary database round trips.

What's the best way to perform bulk updates in EF Core?

The best way to perform bulk updates in EF Core is using ExecuteUpdateAsync and ExecuteDeleteAsync, which execute operations directly against the database for high performance without loading entities into memory.

How do I configure a DbContext with clean entity mapping in EF Core?

Configure a DbContext with clean entity mapping by implementing IEntityTypeConfiguration and using ApplyConfigurationsFromAssembly, organizing entity mapping into discoverable, maintainable configuration classes.

Can I use compiled queries to improve EF Core performance?

Compiled queries improve EF Core performance by pre-compiling LINQ query translation, reducing overhead for frequently executed queries and optimizing database access patterns.

What common anti-patterns should I avoid when using EF Core?

Common EF Core anti-patterns to avoid include lazy loading pitfalls, in-memory filtering mistakes, and fire-and-forget async bugs, ensuring correct query execution and data consistency.

How do I add cross-cutting concerns like auditing to EF Core SaveChanges?

Add cross-cutting concerns like auditing to EF Core SaveChanges by implementing SaveChangesInterceptor, which intercepts persistence operations to inject global filters and auditing logic in a production-safe manner.