Class AggregateRoot
Base class for aggregate roots with built‑in domain event collection.
Implements
Inherited Members
Namespace: Chapar.Core.Abstractions
Assembly: Chapar.Core.dll
Syntax
public abstract class AggregateRoot : IAggregateRoot
Properties
| Edit this page View SourceDomainEvents
Gets the domain events that have been raised but not yet dispatched.
Declaration
public IReadOnlyCollection<IDomainEvent> DomainEvents { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<IDomainEvent> |
Methods
| Edit this page View SourceAddDomainEvent(IDomainEvent)
Adds a domain event to the aggregate's internal collection.
Declaration
public void AddDomainEvent(IDomainEvent domainEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| IDomainEvent | domainEvent |
ClearDomainEvents()
Clears all domain events, usually after they have been dispatched.
Declaration
public void ClearDomainEvents()