예제 #1
0
        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);
            }
        }
예제 #2
0
        protected virtual void Apply(DomainEvent domainEvent)
        {
            if (domainEvent.IsHandled() == false ||
                (EventHandlingStrategy == EventHandlingStratgies.Multiple))
            {
                When(domainEvent);
                domainEvent.SetHandled();
            }
            //EnsureValidState();

            _additionalApplier?.Invoke(domainEvent);
        }