data-dotnet

Implement EF Core data persistence as a hexagonal architecture adapter.

53|4|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/nesbo/dotnet-claude-code-skills --skill data-dotnet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-dotnet
Source: https://github.com/nesbo/dotnet-claude-code-skills/tree/main/data-dotnet
Command: npx skills add https://github.com/nesbo/dotnet-claude-code-skills --skill data-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a complete blueprint for implementing data persistence as an adapter in hexagonal architecture, enabling a domain layer to stay decoupled from storage details while delivering production-ready patterns.

Core Features & Use Cases

  • DataContext configuration: Production-grade and design-time support with migrations.
  • Entity mappings & repository base: Write/read repositories and Unit of Work patterns that support CQRS and DI auto-registration.
  • Schema organization & migrations: Multi-schema design for bounded contexts and a reproducible migration workflow.
  • Testing support: In-memory database tests to validate persistence logic.

Quick Start

Read SKILL.md for complete documentation, including how to configure the DataContext, apply migrations, and wire up DI in a .NET application.

Frequently Asked Questions about data-dotnet

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a data persistence layer with EF Core in hexagonal architecture?

Hexagonal architecture isolates your domain from storage details by treating data persistence as an adapter. This Skill provides a complete blueprint using EF Core—including DataContext configuration, entity mappings, repository bases, and Unit of Work patterns—so your domain layer stays decoupled while your infrastructure handles all database concerns.

What is the Unit of Work pattern and why use it with EF Core repositories?

Unit of Work coordinates multiple repository operations as a single transaction, ensuring data consistency across related entities. This Skill implements it with EF Core to enable atomic writes, simplify testing with in-memory databases, and maintain clean separation between your domain and data access logic.

Can I use EF Core migrations across multiple schemas for bounded contexts?

Yes. This Skill covers schema organization and a reproducible migration workflow that lets you partition bounded contexts into separate schemas, apply targeted migrations, and keep each context's data model independent while remaining in a single EF Core DataContext.

How do I test data persistence logic without a real database?

This Skill includes in-memory database testing support built into the repository base and Unit of Work patterns, allowing you to validate persistence logic in unit tests without spinning up SQL Server or managing test data cleanup.

Does this approach support CQRS with separate read and write repositories?

Yes. The Skill provides repository base patterns and automatic DI registration that support CQRS by letting you implement write repositories for commands and read repositories for queries, keeping read and write models aligned with your architectural intent.

How do I wire up the data layer into my .NET application with dependency injection?

This Skill exposes a public DI API for automatic repository discovery and registration, so you configure the DataContext and repositories once in your DI container and they integrate seamlessly into your application without manual wiring for each entity.