|
|
@ -21,17 +21,22 @@ |
|
|
|
} |
|
|
|
|
|
|
|
private List<INotification> _domainEvents; |
|
|
|
public List<INotification> DomainEvents => _domainEvents; |
|
|
|
|
|
|
|
public IReadOnlyCollection<INotification> DomainEvents => _domainEvents?.AsReadOnly(); |
|
|
|
|
|
|
|
public void AddDomainEvent(INotification eventItem) |
|
|
|
{ |
|
|
|
_domainEvents = _domainEvents ?? new List<INotification>(); |
|
|
|
_domainEvents.Add(eventItem); |
|
|
|
} |
|
|
|
|
|
|
|
public void RemoveDomainEvent(INotification eventItem) |
|
|
|
{ |
|
|
|
if (_domainEvents is null) return; |
|
|
|
_domainEvents.Remove(eventItem); |
|
|
|
_domainEvents?.Remove(eventItem); |
|
|
|
} |
|
|
|
|
|
|
|
public void ClearDomainEvents() |
|
|
|
{ |
|
|
|
_domainEvents?.Clear(); |
|
|
|
} |
|
|
|
|
|
|
|
public bool IsTransient() |
|
|
|