Source profileQuality 62/100

github/awesome-copilot/skills/ef-core/SKILL.md

ef-core

Get best practices for Entity Framework Core

Source repository stars
37,126
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

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

Best for

    Not for

    • Tasks that require unconfirmed production actions or broad system permissions.
    • Environments where the pinned source and install steps cannot be inspected.

    Compatibility matrix

    Platform support, with evidence labels

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeNot declaredNo explicit evidencePortability before use
    CursorNot declaredNo explicit evidencePortability before use
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    Installation

    Inspect first. Install second.

    The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

    Source-detected install commandSource
    npx skills add https://github.com/github/awesome-copilot --skill "skills/ef-core"
    Safe inspection promptEditorial

    Inspect the Agent Skill "ef-core" from https://github.com/github/awesome-copilot/blob/9933dcad5be5caeb288cebcd370eeeb2fc2f1685/skills/ef-core/SKILL.md at commit 9933dcad5be5caeb288cebcd370eeeb2fc2f1685. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

    Workflow

    What the source asks the agent to do

    1. 01

      Data Context Design

      Keep DbContext classes focused and cohesive

      Keep DbContext classes focused and cohesiveUse constructor injection for configuration optionsOverride OnModelCreating for fluent API configuration
    2. 02

      Entity Design

      Use meaningful primary keys (consider natural vs surrogate keys)

      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
    3. 03

      Performance

      Use AsNoTracking() for read-only queries

      Use AsNoTracking() for read-only queriesImplement pagination for large result sets with Skip() and Take()Use Include() to eager load related entities when needed
    4. 04

      Migrations

      Create small, focused migrations

      Create small, focused migrationsName migrations descriptivelyVerify migration SQL scripts before applying to production

    Permission review

    Static risk signals and limitations

    No configured static risk pattern was detected

    This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score62/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars37,126SourceRepository attention, not individual Skill quality
    Compatibility0 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

    Pinned source

    Provenance and original SKILL.md

    Repository
    github/awesome-copilot
    Skill path
    skills/ef-core/SKILL.md
    Commit
    9933dcad5be5caeb288cebcd370eeeb2fc2f1685
    License
    MIT
    Collected
    2026-07-28
    Default branch
    main
    View the original SKILL.md

    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.

    Alternatives

    Compare before choosing