ef-core-persistence

ef-core-persistence is a skill for Claude Code, Codex from vaquarkhan/Fullstack-development-agent-skills. It costs 40 tokens per session (507 once invoked), scanned A, original, MIT.

Guidance for storing and querying relational database data with EF Core 8, a .NET library that maps database tables to application objects.

In plain words
What is it for?
Use it to define entities and mappings, create and review migrations, configure database connections, add auditing or tenant filters, optimize queries, and test with realistic SQL Server or PostgreSQL containers.
Why use it?
It helps avoid slow queries, unsafe schema changes, concurrency problems, and testing approaches that do not resemble production databases.

Skill for Claude CodeCodex

Part of the fullstack-development-agent-skills plugin — 36 skills, 10 commands, 6 agents shipped together

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.

agentmods
npx agentmods add skills/vaquarkhan/fullstack-development-agent-skills/ef-core-persistence
Any agent
npx skills add vaquarkhan/Fullstack-development-agent-skills --skill ef-core-persistence
Clone the repo
git clone --depth 1 https://github.com/vaquarkhan/Fullstack-development-agent-skills

Made for: Claude Code, Codex.

Or install fullstack-development-agent-skills, the plugin that ships this one along with the rest of its 36 skills, 10 commands, 6 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 ef-core-persistence

README.md
[![agentmods](https://agentmods.dev/badge/skills/vaquarkhan/fullstack-development-agent-skills/ef-core-persistence.svg)](https://agentmods.dev/skills/vaquarkhan/fullstack-development-agent-skills/ef-core-persistence)
Your own site
<a href="https://agentmods.dev/skills/vaquarkhan/fullstack-development-agent-skills/ef-core-persistence"><img src="https://agentmods.dev/badge/skills/vaquarkhan/fullstack-development-agent-skills/ef-core-persistence.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00040 $0.00507
Opus 5 $0.00020 $0.00253
Sonnet 5 $0.00008 $0.00101
Haiku 4.5 $0.00004 $0.00051

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

Security

Grade A, and why

ef-core-persistence 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 5d 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.

skill-packs/dotnet/efcore/ef-core-persistence/SKILL.md · 61 lines

How it starts

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

EF Core Persistence

Use When

  • Implementing EF Core data access in ASP.NET Core services
  • Designing entities, configurations, migrations, and query performance
  • Pairing with aspnetcore-minimal-apis or skills/dotnet-aspnet-core-microservices

Workflow

  1. Define entities and IEntityTypeConfiguration classes per aggregate.
  2. Register DbContext with pooled factory; configure connection resiliency.
  3. Use migrations with review for locking — prefer expand/contract for large tables.
  4. Implement repositories or specifications; project to DTOs in queries.
  5. Add interceptors for auditing, soft delete, or multi-tenant filters.
  6. Test with Testcontainers SQL Server/Postgres or in-memory only for unit scope.

Required Checks

  • No N+1 — use Select projections or explicit Include with purpose
  • AsNoTracking on read-only queries
  • Concurrency tokens on contested aggregates
  • Migrations tested against production-like row counts when tables are large

Examples And Templates

See examples/ for side-by-side good vs bad patterns agents commonly get wrong. See templates/ for copy-paste starters aligned with this skill.

Decision Framework

  • Prefer configurations over data annotations for team consistency.
  • Owned types for value objects; avoid primitive obsession on entities.
  • Raw SQL only for reporting or bulk ops — document and parameterize.
  • Split read models (Dapper/raw SQL) when EF projections are insufficient.

Common Rationalizations And Rebuttals

  • "Lazy loading is convenient." -> Causes N+1 in APIs; use explicit loading or projections.
  • "One DbContext for everything." -> Bounded contexts may need separate contexts.
  • "Migrate in app startup always." -> Run migrations in CI/CD job with rollback plan.

Evidence Pack

  • Migration script with expand/contract notes
  • Query plan or EF logging proof for critical list endpoints
  • Concurrency conflict test output
  • Interceptor audit sample (created/updated by)

Exit Criteria

  • Queries are tracked appropriately; hot paths avoid N+1
  • Migrations are safe for production table sizes
  • Multi-tenant or soft-delete rules enforced at persistence layer

Read the full file on GitHub · 61 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 61 lines · 40 tokens per session scan A d7c398dcc41a

Subscribe to this mod's changes

ef-core-persistence is a skill published in the GitHub repository vaquarkhan/Fullstack-development-agent-skills (2 stars, last pushed 21d ago), licensed MIT. It adds 40 tokens to every session and 507 once invoked, about $0.0002 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-31.

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