refactor: simplify condition checks in AfterSaveChangesAsync for clarity

This commit is contained in:
Jean Gatto
2025-02-09 19:42:22 -03:00
parent f2e6b0021f
commit 811b9b1d81
+4 -2
View File
@@ -105,8 +105,10 @@ internal sealed class UnitOfWork(
IReadOnlyList<BaseEvent> domainEvents,
IReadOnlyList<EventStore> eventStores)
{
// If there are no domain events or event stores, return without performing any actions.
if (!domainEvents.Any() || !eventStores.Any())
if (!domainEvents.Any())
return;
if (!eventStores.Any())
return;
// Publish each domain event using _mediator.