dotnet-entity-framework-core

Guide Entity Framework Core data modeling, query optimization, and migrations for .NET applications.

466|35|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/managedcode/dotnet-skills --skill dotnet-entity-framework-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-entity-framework-core
Source: https://github.com/managedcode/dotnet-skills/tree/main/skills/dotnet-entity-framework-core
Command: npx skills add https://github.com/managedcode/dotnet-skills --skill dotnet-entity-framework-core

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps .NET developers design, tune, and review Entity Framework Core data access, ensuring efficient modeling, migrations, query performance, and proper lifetime management for modern applications.

Core Features & Use Cases

  • Data Modeling: Guidance on configuring entities, relationships, and constraints using Fluent API or Data Annotations.
  • Query Optimization: Techniques to write efficient LINQ queries, avoid N+1 problems, and leverage AsNoTracking, projections, and compiled queries.
  • Migrations Management: Best practices for creating, reviewing, and applying database migrations, including data migrations.
  • Performance Tuning: Strategies for indexing, batch operations, and concurrency control.
  • Use Case: Optimize a slow-loading e-commerce product page by analyzing EF Core queries, ensuring proper indexing, and implementing efficient data loading strategies to reduce database load and improve response times.

Quick Start

Review the provided EF Core query for potential N+1 issues and suggest optimizations.

Frequently Asked Questions about dotnet-entity-framework-core

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

FAQPage Schema
How do I fix N+1 query problems in Entity Framework Core?

Fix N+1 query problems in Entity Framework Core by using eager loading with Include, projections, or split queries. This Skill guides you in analyzing LINQ queries to ensure efficient data loading and reduce database round trips.

What is the best way to manage database migrations in EF Core?

The best way to manage database migrations in EF Core involves following best practices for creating, reviewing, and applying schema changes. This Skill provides guidance on handling both structural migrations and data migrations effectively.

How does AsNoTracking improve EF Core query performance?

AsNoTracking improves EF Core query performance by bypassing the change tracker for read-only operations, reducing memory overhead. This Skill identifies when to apply AsNoTracking and other optimizations like compiled queries for high-performance data access.

Can I use this EF Core guidance for batch operations in .NET?

Yes, you can use this EF Core guidance for batch operations in .NET applications. It supports EF Core 7+ and provides specific patterns for executing batch operations and compiled queries to optimize data access performance.

Why is my DbContext lifetime causing issues in modern .NET applications?

Your DbContext lifetime is causing issues because incorrect management leads to concurrency conflicts and memory leaks. This Skill addresses common anti-patterns by guiding you on proper DbContext lifetime management for modern .NET applications.

How do I configure entity relationships using Fluent API in EF Core?

Configure entity relationships using Fluent API in EF Core to precisely define constraints and mappings. This Skill offers guidance on data modeling techniques using both Fluent API and Data Annotations for efficient database schema design.