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 virtual void Apply(DomainEvent domainEvent) { if (domainEvent.IsHandled() == false || (EventHandlingStrategy == EventHandlingStratgies.Multiple)) { When(domainEvent); domainEvent.SetHandled(); } //EnsureValidState(); _additionalApplier?.Invoke(domainEvent); }