github avatar

Ef Core

This gives Claude a solid foundation in EF Core patterns so it can spot common mistakes in your data access code. It'll catch things like missing AsNoTracking() on read queries, N+1 problems from poor Include usage, and bloated DbContext classes that mix concerns. The skill covers the full stack from entity design and migrations to performance tuning and testing strategies. Most useful when you're building out data layers or reviewing existing EF implementations. It's opinionated about things like using IEntityTypeConfiguration for complex models and DbContextFactory for non-web apps, which aligns well with Microsoft's current guidance.

skills.sh installs
9.7K
GitHub stars
41K
last updated
Aug 21, 2026

Install

$ npx -y skills add github/awesome-copilot --skill ef-core --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Sponsors

Details

Repository
github.com/github/awesome-copilot
Categories
Git & Pull Requests, AI & Agent Building

More from github/awesome-copilot

All 318
1github avatarazure-deployment-preflightgithub/awesome-copilotPerforms comprehensive preflight validation of Bicep deployments to Azure, including template syntax validation, what-if analysis, and permission checks. Use th9.6Kskills.sh installs
2github avatarwrite-coding-standards-from-filegithub/awesome-copilotWrite a coding standards document for a project using the coding styles from the file(s) and/or folder(s) passed as arguments in the prompt.9.6Kskills.sh installs
3github avatarmy-issuesgithub/awesome-copilotList my issues in the current repository9.6Kskills.sh installs
4github avatarcreate-spring-boot-java-projectgithub/awesome-copilotCreate Spring Boot Java Project Skeleton9.6Kskills.sh installs
5github avatarappinsights-instrumentationgithub/awesome-copilotInstrument a webapp to send useful telemetry data to Azure App Insights9.5Kskills.sh installs
6github avataropenapi-to-application-codegithub/awesome-copilotGenerate a complete, production-ready application from an OpenAPI specification9.5Kskills.sh installs