How-To Guides
Task-oriented guides for accomplishing specific goals with JD.Domain. Each guide focuses on a single task with clear steps and working code examples.
Domain Modeling
Learn how to define your domain model:
- Define Entities - Create entity definitions with properties
- Define Value Objects - Model value objects and complex types
- Define Enums - Create enumeration types
Business Rules
Learn how to create and use business rules:
- Create Invariants - Define always-true rules
- Create Validators - Build context-dependent validation rules
- Create Policies - Implement authorization and business policies
- Create Derivations - Define computed properties
- Compose Rules - Combine and reuse multiple rules
Configuration
Learn how to configure EF Core integration:
- Configure Keys - Set up primary and composite keys
- Configure Indexes - Create unique and filtered indexes
- Configure Relationships - Define foreign keys and navigation
Integration
Learn how to integrate with frameworks:
- Apply to ModelBuilder - Integrate with EF Core DbContext
- Validate in ASP.NET - Add automatic API validation
Generators
Learn how to use source generators:
- Generate FluentValidation - Auto-generate FluentValidation validators
- Generate Domain Types - Create construction-safe domain types
Version Management
Learn how to track domain evolution:
- Create Snapshots - Save domain state at points in time
- Compare Snapshots - Detect changes between versions
- Detect Breaking Changes - Identify breaking changes automatically
- Generate Migration Plans - Create step-by-step migration guides
Tooling
Learn how to use JD.Domain tools:
- Use CLI Tools - Command-line tools for snapshots and diffs
- Use T4 Templates - Integrate with T4 for code generation
Guide Format
Each how-to guide follows this structure:
- Goal - What you'll accomplish
- Prerequisites - What you need before starting
- Steps - Numbered steps with code examples
- Result - What you should see
- Next Steps - Related guides
Finding the Right Guide
By Task
- I want to define my domain → Domain Modeling guides
- I want to add validation → Business Rules guides
- I want to use EF Core → Configuration + Integration guides
- I want to generate code → Generator guides
- I want to track changes → Version Management guides
- I want to use command-line tools → Tooling guides
By Experience Level
Beginner:
- Define Entities
- Create Invariants
- Apply to ModelBuilder
- Use CLI Tools
Intermediate:
- Define Value Objects
- Create Validators
- Configure Indexes
- Generate FluentValidation
- Create Snapshots
Advanced:
- Define Enums
- Create Policies
- Configure Relationships
- Generate Domain Types
- Generate Migration Plans
See Also
- Tutorials - Step-by-step walkthroughs
- Concepts - Deep dives into architecture
- API Reference - Complete API documentation