예제 #1
0
        protected void Apply(DomainEvent domainEvent)
        {
            if (domainEvent is EntityBasedDomainEvent @event)
            {
                if (@event.EntityId != Id)
                {
                    When(domainEvent);
                    domainEvent.SetHandled();
                }
            }
            else
            {
                When(domainEvent);
                domainEvent.SetHandled();
            }

            _addtionalApplier(domainEvent);
        }
예제 #2
0
        protected virtual void Apply(DomainEvent domainEvent)
        {
            if (domainEvent.IsHandled() == false ||
                (EventHandlingStrategy == EventHandlingStratgies.Multiple))
            {
                When(domainEvent);
                domainEvent.SetHandled();
            }
            //EnsureValidState();

            _additionalApplier?.Invoke(domainEvent);
        }