efcore-patterns

efcore-patterns is a skill for Claude Code from AratKruglik/claude-sdlc. It costs 255 tokens per session (2,236 once invoked), scanned A, original, MIT.

A guide to Entity Framework Core, a .NET library that lets applications work with databases through C# objects. It covers database contexts, table relationships, queries, indexes, constraints, and efficient data loading.

In plain words
What is it for?
Use it when designing database models, configuring tables and relationships, writing queries, projecting results into response objects, and avoiding repeated database queries.
Why use it?
It helps prevent common database problems such as loading data one record at a time, creating unwanted relationships, or returning more data than needed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the aspnet-core-plugin plugin — 2 skills, 2 agents shipped together

Good fit Use it when designing database models, configuring tables and relationships, writing queries, projecting results into response objects, and avoiding repeated database queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aratkruglik/claude-sdlc/efcore-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AratKruglik/claude-sdlc --skill efcore-patterns
Clone the repo
git clone --depth 1 https://github.com/AratKruglik/claude-sdlc

Made for: Claude Code.

Or install aspnet-core-plugin, the plugin that ships this one along with the rest of its 2 skills, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for efcore-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/efcore-patterns/github.svg)](https://agentmods.dev/skills/aratkruglik/claude-sdlc/efcore-patterns)
Your own site
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/efcore-patterns"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/efcore-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for efcore-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/efcore-patterns"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/efcore-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 255 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,236 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00255 $0.02236
Opus 5 $0.00128 $0.01118
Sonnet 5 $0.00051 $0.00447
Haiku 4.5 $0.00026 $0.00224

Measured 9d ago against content hash eec59ac50c55, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

efcore-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/aspnet-core-plugin/skills/efcore-patterns/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

EF Core Patterns

DbContext design

public sealed class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }

    public DbSet<User> Users => Set<User>();
    public DbSet<Order> Orders => Set<Order>();
    public DbSet<OrderLine> OrderLines => Set<OrderLine>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        // Discover all IEntityTypeConfiguration<T> in the assembly automatically
        modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
    }
}

Use ApplyConfigurationsFromAssembly — it discovers all IEntityTypeConfiguration<T> implementations automatically, avoiding the need to register each entity manually in OnModelCreating.

Use DbSet<T> expression-bodied properties (=> Set<T>()) to avoid null warnings and simplify the class.

Entity configuration — Fluent API

public sealed class OrderConfiguration : IEntityTypeConfiguration<Order>
{
    public void Configure(EntityTypeBuilder<Order> builder)
    {
        builder.ToTable("orders");
        builder.HasKey(o => o.Id);

        builder.Property(o => o.Status)
               .HasConversion<string>()   // store enum as string for readability
               .HasMaxLength(50)
               .IsRequired();

        builder.Property(o => o.Total)
               .HasPrecision(18, 2)
               .IsRequired();

        builder.Property(o => o.CreatedAt)
               .IsRequired();

        builder.Property(o => o.Notes)
               .HasMaxLength(1000)
               .IsRequired(false);

        builder.HasIndex(o => o.CustomerId);
        builder.HasIndex(o => new { o.Status, o.CreatedAt });

        builder.HasOne(o => o.Customer)
               .WithMany(c => c.Orders)
               .HasForeignKey(o => o.CustomerId)
               .OnDelete(DeleteBehavior.Restrict);   // don't cascade-delete orders with customer

        builder.HasMany(o => o.Lines)
               .WithOne(l => l.Order)
               .HasForeignKey(l => l.OrderId)
               .OnDelete(DeleteBehavior.Cascade);   // deleting an order removes its lines
    }
}

Read the full file on GitHub · 272 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 272 lines · 255 tokens per session scan A eec59ac50c55

Subscribe to this mod's changes

efcore-patterns is a skill published in the GitHub repository AratKruglik/claude-sdlc (33 stars, last pushed 4d ago), licensed MIT. It adds 255 tokens to every session and 2,236 once invoked, about $0.0013 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

azure-resource-manager-postgresql-dotnet

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…

microsoft/skills · 97 tokens

optimizing-ef-core-queries

Optimize and improve the performance of slow Entity Framework Core (EF Core) queries: make them generate less SQL, make fewer database round-trips, and return results faster. Use whenever an EF Core or DbContext query or data-access path is slow or should be made faster — whether or not EF Core owns the database…

dotnet/skills · 86 tokens

entity-framework-core

Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET applications. USE FOR: DbContext, migrations, model configuration, EF queries, tracking, loading, performance, transactions, and EF6 migration decisions. DO NOT USE FOR…

managedcode/dotnet-skills · 110 tokens

efcore-patterns

Entity Framework Core best practices including NoTracking by default, query splitting for navigation collections, migration management, dedicated migration services, and common pitfalls to avoid.

Aaronontheweb/dotnet-skills · 35 tokens

entity-framework6

Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step. USE FOR: EF6 codebases; runtime versus ORM migration decisions; EDMX, code-first, ObjectContext, and legacy data-access review. DO NOT USE FOR: unrelated stacks…

managedcode/dotnet-skills · 114 tokens

ef-core

Entity Framework Core patterns for .NET 10. Covers DbContext configuration, migrations workflow, interceptors, compiled queries, ExecuteUpdateAsync, ExecuteDeleteAsync, value converters, and query optimization. Load this skill when working with databases, writing queries, managing schema changes, or when the user…

codewithmukesh/dotnet-claude-kit · 113 tokens