Gryd.Domain
DDD building blocks: Entity, AggregateRoot, ValueObject, and Domain Events.
Installation
bash dotnet add package Gryd.Domain
Overview
| Component | Description |
|---|---|
| BaseEntity | Base class for all entities with audit and soft delete |
| AggregateRoot | Aggregate root with domain events |
| ValueObject | Immutable value objects |
| DomainEvent | Domain event base class |
| Interfaces | IEntity, IAuditable, ISoftDeletable, IHasTenant, IAggregateRoot |
Architecture
Gryd.Domain implements DDD tactical patterns:
- Entity: Objects with identity that persists over time
- Value Object: Immutable objects defined by their values
- Aggregate Root: Transaction boundaries with domain events
- Domain Event: Decouple side effects from business logic
Multi-tenancy Support
Built-in support for multi-tenant applications:
- TenantScopedEntity: Entity with TenantId
- TenantScopedAggregateRoot: Aggregate root with TenantId
- IHasTenant interface for tenant filtering