Skip to content
Back to skills

Csharp Efcore

ASecurity

Write fast, migration-safe Entity Framework Core code with tracking control, indexes, and split queries

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsc#sqldatabaseperformance

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill csharp-efcore --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Csharp Efcore?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Csharp Efcore
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-csharp-efcore/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-csharp-efcore)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Write fast, migration-safe Entity Framework Core code with tracking control, indexes, and split queries
profile: standard
tags: csharp, dotnet, database, orm
---

# C# EF Core

Use when authoring `DbContext`, LINQ queries, or schema migrations with Entity Framework Core.

## Query performance
- Add `.AsNoTracking()` (or set query-level default on read-only contexts) for read queries so EF avoids change-tracker overhead.
- Project directly with `.Select(...)` into DTOs instead of materializing full entities and mapping in memory.
- Use `.AsSplitQuery()` when loading multiple collection `Include(...)` branches to avoid Cartesian row explosion.

## Migrations and concurrency
- Never share a single scoped `DbContext` concurrently across parallel `Task.WhenAll` queries; use `IDbContextFactory<T>` for concurrent work.
- Always generate SQL scripts (`dotnet ef migrations script --idempotent`) and review column drops/rebuilds before running in production.
- Configure explicit concurrency tokens (`IsRowVersion` / `IsConcurrencyToken`) on inventory or balance updates.

## Verify
Inspect generated SQL via `.ToQueryString()` or EF logging, and run integration tests against a real database/Testcontainer.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.