nesbo/dotnet-claude-code-skills/data-dotnet
Claude Code and agent skill by nesbo/dotnet-claude-code-skills
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install nesbo/dotnet-claude-code-skills/data-dotnetSKILL.md
EF Core Data Persistence Layer - Hexagonal Architecture Adapter
Overview
This skill provides a comprehensive guide to implementing the data persistence layer using Entity Framework Core as an adapter in a hexagonal architecture (ports and adapters pattern). The data layer is a library that encapsulates its implementation internally and exposes DI registration publicly for wiring into applications.
This skill complements the ddd-dotnet-basics.md skill and assumes familiarity with Domain layer patterns.
Key Architecture Principles
Key Benefits:
- Testability: In-memory database for unit/integration tests
- Separation of Concerns: Domain knows nothing about EF Core
- CQRS Support: Separate read/write repository base classes
- Schema Organization: Multiple database schemas for bounded contexts
- Convention-based Registration: Automatic repository discovery and registration
Project Structure
DbContext Configuration
Main DbContext
The DataContext is the central EF Core context with specific patterns for production and testing.
Key Patterns:
- Two constructors: Parameterized for runtime, parameterless for design-time
- Conditional configuration: Fallback for migration tools
- Assembly scanning: Auto-discovers entity configurations
- Migration runner: Resilient startup with exponential backoff
- Logging: Track migration attempts and failures
Entity Configurations
Entity configurations use the Fluent API to map domain objects to database tables. Each entity gets its own configuration class.
Configuration Helper
Reusable utilities for common configuration patterns:
Aggregate Configuration Example
Configuration for an aggregate root with child entities:
Entity Configuration Example
Configuration for child entities:
Simple Aggregate Configuration
Configuration for aggregates without child entities:
One-to-One Relationship Configuration
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdata-dotnet/SKILL.md
Popularity
- 7-day trend score
- 0
Refreshed 17 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nesbo/dotnet-claude-code-skills/data-dotnet)