|
|
@ -6,12 +6,8 @@ |
|
|
|
|
|
|
|
public abstract class Entity |
|
|
|
{ |
|
|
|
|
|
|
|
int? _requestedHashCode; |
|
|
|
int _Id; |
|
|
|
|
|
|
|
private List<INotification> _domainEvents; |
|
|
|
|
|
|
|
int _Id; |
|
|
|
public virtual int Id |
|
|
|
{ |
|
|
|
get |
|
|
@ -24,13 +20,13 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private List<INotification> _domainEvents; |
|
|
|
public List<INotification> DomainEvents => _domainEvents; |
|
|
|
public void AddDomainEvent(INotification eventItem) |
|
|
|
{ |
|
|
|
_domainEvents = _domainEvents ?? new List<INotification>(); |
|
|
|
_domainEvents.Add(eventItem); |
|
|
|
} |
|
|
|
|
|
|
|
public void RemoveDomainEvent(INotification eventItem) |
|
|
|
{ |
|
|
|
if (_domainEvents is null) return; |
|
|
@ -74,7 +70,6 @@ |
|
|
|
return base.GetHashCode(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static bool operator ==(Entity left, Entity right) |
|
|
|
{ |
|
|
|
if (Object.Equals(left, null)) |
|
|
|