protected void ApplyToEnity(IInternalEventHandler entity, DomainEvent domainEvent, Boolean onlyIfNotAlreadyHandeld = true) { if (entity == null || domainEvent == null) { return; } if (domainEvent.IsHandled() == false || onlyIfNotAlreadyHandeld == false) { entity.Handle(domainEvent); } }
protected void ApplyToEntity(IInternalEventHandler entity, object @event) => entity?.Handle(@event);
protected void ApplyToEntity(IInternalEventHandler entity, DomainEvent domainEvent) => entity?.Handle(domainEvent);