Browse Source
Refactor event clearing methods with null-conditional operator
pull/24533/head
maliming
1 month ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
4 additions and
24 deletions
-
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/BasicAggregateRoot.cs
|
|
|
@ -25,22 +25,12 @@ public abstract class BasicAggregateRoot : Entity, |
|
|
|
|
|
|
|
public virtual void ClearLocalEvents() |
|
|
|
{ |
|
|
|
if (_localEvents == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_localEvents.Clear(); |
|
|
|
_localEvents?.Clear(); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void ClearDistributedEvents() |
|
|
|
{ |
|
|
|
if (_distributedEvents == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_distributedEvents.Clear(); |
|
|
|
_distributedEvents?.Clear(); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void AddLocalEvent(object eventData) |
|
|
|
@ -87,22 +77,12 @@ public abstract class BasicAggregateRoot<TKey> : Entity<TKey>, |
|
|
|
|
|
|
|
public virtual void ClearLocalEvents() |
|
|
|
{ |
|
|
|
if (_localEvents == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_localEvents.Clear(); |
|
|
|
_localEvents?.Clear(); |
|
|
|
} |
|
|
|
|
|
|
|
public virtual void ClearDistributedEvents() |
|
|
|
{ |
|
|
|
if (_distributedEvents == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_distributedEvents.Clear(); |
|
|
|
_distributedEvents?.Clear(); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void AddLocalEvent(object eventData) |
|
|
|
|