Interface IAggregateRoot
Marks an entity as an aggregate root that can collect domain events.
Namespace: Chapar.Core.Abstractions
Assembly: Chapar.Core.dll
Syntax
public interface IAggregateRoot
Properties
| Edit this page View SourceDomainEvents
Gets the domain events that have been raised but not yet dispatched.
Declaration
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
void AddDomainEvent(IDomainEvent domainEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| IDomainEvent | domainEvent |
ClearDomainEvents()
Clears all domain events, usually after they have been dispatched.
Declaration
void ClearDomainEvents()