Shared : Domain
The Shared.Domain project provides the foundational abstractions for the Domain layer in a Domain-Driven Design architecture. It defines marker interfaces, a base entity class with domain event support, and contracts for repositories and services.
Domain Events
The IDomainEvent interface is a marker interface that all domain events must implement. It serves as a base contract for representing meaningful occurrences within the domain.
Entities
- IEntity : An interface that exposes a read-only collection of domain events and a
ClearDomainEventsmethod, defining the contract for any domain entity. - Entity<TEntityId> : An abstract base class implementing
IEntitywith a strongly-typed identifier. It provides aRaiseDomainEventprotected method to enqueue events and aClearDomainEventsmethod to flush them after dispatch.
Repositories
The IDomainRepository interface is a marker interface that all domain repositories must implement. It serves as a base contract for persistence-related abstractions in the Domain layer.
Services
The IDomainService interface is a marker interface that all domain services must implement. It serves as a base contract for domain logic services that encapsulate business rules and operations.