dotnet-domain-modeling

Implements DSA tactical C# . .NET domain patterns including aggregates, entities, values, events, contracts, exceptions.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-domain-modeling-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-domain-modeling
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-domain-modeling
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-domain-modeling-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance on implementing core Domain-Driven Design (DDD) tactical patterns in C#, helping developers build robust and maintainable .NET applications by clearly defining business logic and data structures.

Core Features & Use Cases

  • Aggregate Roots and Entities: Design and implement entities with identity and aggregate roots that manage domain events and invariants.
  • Value Objects: Create immutable objects defined by their attributes, ensuring data integrity and expressiveness.
  • Domain Events: Define and dispatch events to decouple domain logic and trigger side effects.
  • Rich vs. Anemic Models: Understand the trade-offs and choose the appropriate modeling approach.
  • Repository Contracts: Define clear interfaces for data access without leaking persistence concerns.
  • Use Case: When building an e-commerce platform, use this Skill to correctly model Order aggregates, Money value objects, and OrderCreated domain events, ensuring business rules are enforced within the domain layer.

Quick Start

Implement an Order aggregate root with a CustomerId and AddLine method using the provided C# examples.

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 aggregate roots and entities in C#?

To implement aggregate roots and entities in C#, design entities with unique identity and build aggregate roots that manage domain events and enforce invariants within the domain layer.

What is the difference between rich and anemic domain models in .NET?

A rich domain model encapsulates business logic within entities and aggregate roots, while an anemic model uses data structures with logic in external services, and choosing between them involves understanding these architectural trade-offs.

How do I create immutable value objects in C# for domain modeling?

To create immutable value objects in C#, define objects strictly by their attributes rather than identity, ensuring data integrity and expressiveness without leaking persistence concerns into the domain layer.

How do I decouple domain logic using domain events in .NET?

To decouple domain logic in .NET, define and dispatch domain events within aggregate roots to trigger side effects, keeping business rules encapsulated independently from persistence technologies.

How do I define repository contracts without leaking persistence concerns?

Define repository contracts by creating clear interfaces for data access within the domain layer, ensuring the domain remains independent of underlying persistence technologies and database implementations.

When should I use Domain-Driven Design tactical patterns for business modeling?

Use Domain-Driven Design tactical patterns when building complex .NET applications like e-commerce platforms, to correctly model aggregates, value objects, and events so business rules are strictly enforced.