dotnet-domain-modeling

Implement DDD tactical patterns with C# code examples in .NET.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-domain-modeling-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-domain-modeling
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-domain-modeling
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-domain-modeling-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides patterns and C# code examples for effectively modeling complex business domains using Domain-Driven Design (DDD) principles, ensuring robust and maintainable software.

Core Features & Use Cases

  • Domain Modeling: Implement core DDD concepts like Aggregates, Entities, Value Objects, and Domain Events.
  • Code Examples: Provides concrete C# code for base classes and concrete implementations of domain patterns.
  • Use Case: When designing a new e-commerce system, use this Skill to define how Order aggregates, Money value objects, and OrderCreated domain events should be structured to accurately represent business rules.

Quick Start

Define a CustomerId value object using a C# record to enforce non-empty string constraints.

Frequently Asked Questions about dotnet-domain-modeling

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

FAQPage Schema
How do I implement domain-driven design tactical patterns in C#?

To implement domain-driven design in C#, use base classes for aggregate roots, entities, and value objects to encapsulate business logic and enforce invariants. This approach separates your rich domain model from persistence concerns.

What is a value object in domain modeling, and how do I define one in C#?

A value object in domain modeling represents a domain concept without identity. You can define it in C# using a record type to enforce constraints, such as ensuring a CustomerId contains a non-empty string.

How do I structure aggregate roots and domain events in a .NET application?

Structure aggregate roots in .NET by encapsulating related entities and enforcing transactional consistency. Define domain events within these aggregates to signal state changes, like an OrderCreated event, ensuring business rules are accurately represented.

When should I separate my domain model from persistence concerns in .NET?

Separate your domain model from persistence concerns in .NET when building complex business domains to ensure robust and maintainable software. This separation allows your domain logic to remain independent of database implementation details.

Does domain modeling require specific dependencies to implement DDD patterns in C#?

No, domain modeling in C# does not require specific external dependencies. You can implement tactical Domain-Driven Design patterns like repository contracts and aggregates using pure C# code structures without relying on third-party libraries.

What is the best way to model business invariants within a domain aggregate?

The best way to model business invariants within a domain aggregate is to encapsulate state changes within the aggregate root's methods. This ensures all business rules are enforced consistently before any domain events are published.