Minor refactoring at Seedwork
This commit is contained in:
parent
5af3bb62d0
commit
1b51865349
@ -6,12 +6,8 @@
|
|||||||
|
|
||||||
public abstract class Entity
|
public abstract class Entity
|
||||||
{
|
{
|
||||||
|
|
||||||
int? _requestedHashCode;
|
int? _requestedHashCode;
|
||||||
int _Id;
|
int _Id;
|
||||||
|
|
||||||
private List<INotification> _domainEvents;
|
|
||||||
|
|
||||||
public virtual int Id
|
public virtual int Id
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -24,13 +20,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<INotification> _domainEvents;
|
||||||
public List<INotification> DomainEvents => _domainEvents;
|
public List<INotification> DomainEvents => _domainEvents;
|
||||||
public void AddDomainEvent(INotification eventItem)
|
public void AddDomainEvent(INotification eventItem)
|
||||||
{
|
{
|
||||||
_domainEvents = _domainEvents ?? new List<INotification>();
|
_domainEvents = _domainEvents ?? new List<INotification>();
|
||||||
_domainEvents.Add(eventItem);
|
_domainEvents.Add(eventItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveDomainEvent(INotification eventItem)
|
public void RemoveDomainEvent(INotification eventItem)
|
||||||
{
|
{
|
||||||
if (_domainEvents is null) return;
|
if (_domainEvents is null) return;
|
||||||
@ -74,7 +70,6 @@
|
|||||||
return base.GetHashCode();
|
return base.GetHashCode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool operator ==(Entity left, Entity right)
|
public static bool operator ==(Entity left, Entity right)
|
||||||
{
|
{
|
||||||
if (Object.Equals(left, null))
|
if (Object.Equals(left, null))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user