Created
February 3, 2022 12:01
-
-
Save DannyRusnok/e6ba64c20ba27297f34f9744ddec5fe0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class AggregateRoot{ | |
private readonly List<INotification> _domainEvents = new List<INotification>(); | |
public IReadOnlyCollection<INotification> DomainEvents => _domainEvents.AsReadOnly(); | |
public void AddDomainEvent(INotification eventItem) | |
{ | |
_domainEvents.Add(eventItem); | |
} | |
public void RemoveDomainEvent(INotification eventItem) | |
{ | |
_domainEvents.Remove(eventItem); | |
} | |
public void ClearDomainEvents() | |
{ | |
_domainEvents.Clear(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment