Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
github avatar

Ef Core

  • 9.2k installs
  • 37.1k repo stars
  • Updated July 28, 2026
  • github/awesome-copilot

ef-core is an agent skill that Get best practices for Entity Framework Core.

About

Get best practices for Entity Framework Core name ef-core description Get best practices for Entity Framework Core Entity Framework Core Best Practices Your goal is to help me follow best practices when working with Entity Framework Core Data Context Design Keep DbContext classes focused and cohesive Use constructor injection for configuration options Override OnModelCreating for fluent API configuration Separate entity configurations using IEntityTypeConfiguration Consider using DbContextFactory pattern for console apps or tests Entity Design Use meaningful primary keys consider natural vs surrogate keys Implement proper relationships one-to-one one-to-many many-to-many Use data annotations or fluent API for constraints and validations Implement appropriate navigational properties Consider using owned entity types for value objects Performance Use AsNoTracking for read-only queries Implement pagination for large result sets with Skip and Take Use Include to eager load related entities when needed Consider projection Select to retrieve only required fields Use compiled queries for frequently executed queries Avoid N 1 query problems by properly including related data Migrations Cr.

  • Entity Framework Core Best Practices
  • Keep DbContext classes focused and cohesive
  • Use constructor injection for configuration options
  • Override OnModelCreating for fluent API configuration
  • Separate entity configurations using IEntityTypeConfiguration

Ef Core by the numbers

  • 9,159 all-time installs (skills.sh)
  • +48 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #112 of 2,184 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

ef-core capabilities & compatibility

Capabilities
entity framework core best practices · keep dbcontext classes focused and cohesive · use constructor injection for configuration opti · override onmodelcreating for fluent api configur · separate entity configurations using ientitytype
Use cases
documentation
From the docs

What ef-core says it does

--- name: ef-core description: 'Get best practices for Entity Framework Core' --- # Entity Framework Core Best Practices Your goal is to help me follow best p
SKILL.md
npx skills add https://github.com/github/awesome-copilot --skill ef-core

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs9.2k
repo stars37.1k
Security audit3 / 3 scanners passed
Last updatedJuly 28, 2026
Repositorygithub/awesome-copilot

What problem does ef-core solve for developers using this skill?

Get best practices for Entity Framework Core

Who is it for?

Developers who need ef-core patterns described in the cached skill documentation.

Skip if: Skip when docs are empty or the task is outside the skill's documented scope.

When should I use this skill?

Get best practices for Entity Framework Core

What you get

Actionable workflows and conventions from SKILL.md for ef-core.

  • EF Core model and DbContext code following documented patterns

Files

SKILL.mdMarkdownGitHub ↗

Entity Framework Core Best Practices

Your goal is to help me follow best practices when working with Entity Framework Core.

Data Context Design

  • Keep DbContext classes focused and cohesive
  • Use constructor injection for configuration options
  • Override OnModelCreating for fluent API configuration
  • Separate entity configurations using IEntityTypeConfiguration
  • Consider using DbContextFactory pattern for console apps or tests

Entity Design

  • Use meaningful primary keys (consider natural vs surrogate keys)
  • Implement proper relationships (one-to-one, one-to-many, many-to-many)
  • Use data annotations or fluent API for constraints and validations
  • Implement appropriate navigational properties
  • Consider using owned entity types for value objects

Performance

  • Use AsNoTracking() for read-only queries
  • Implement pagination for large result sets with Skip() and Take()
  • Use Include() to eager load related entities when needed
  • Consider projection (Select) to retrieve only required fields
  • Use compiled queries for frequently executed queries
  • Avoid N+1 query problems by properly including related data

Migrations

  • Create small, focused migrations
  • Name migrations descriptively
  • Verify migration SQL scripts before applying to production
  • Consider using migration bundles for deployment
  • Add data seeding through migrations when appropriate

Querying

  • Use IQueryable judiciously and understand when queries execute
  • Prefer strongly-typed LINQ queries over raw SQL
  • Use appropriate query operators (Where, OrderBy, GroupBy)
  • Consider database functions for complex operations
  • Implement specifications pattern for reusable queries

Change Tracking & Saving

  • Use appropriate change tracking strategies
  • Batch your SaveChanges() calls
  • Implement concurrency control for multi-user scenarios
  • Consider using transactions for multiple operations
  • Use appropriate DbContext lifetimes (scoped for web apps)

Security

  • Avoid SQL injection by using parameterized queries
  • Implement appropriate data access permissions
  • Be careful with raw SQL queries
  • Consider data encryption for sensitive information
  • Use migrations to manage database user permissions

Testing

  • Use in-memory database provider for unit tests
  • Create separate testing contexts with SQLite for integration tests
  • Mock DbContext and DbSet for pure unit tests
  • Test migrations in isolated environments
  • Consider snapshot testing for model changes

When reviewing my EF Core code, identify issues and suggest improvements that follow these best practices.

Related skills

How it compares

Choose ef-core over generic database skills when the stack is specifically Entity Framework Core on .NET.

FAQ

What does ef-core do?

Get best practices for Entity Framework Core

When should I use ef-core?

Get best practices for Entity Framework Core

Is ef-core safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.