public IEnumerable <IDomainEvent <ThingyAggregate, ThingyId> > Upgrade(IDomainEvent <ThingyAggregate, ThingyId> domainEvent)
            {
                var testEvent2 = domainEvent as IDomainEvent <ThingyAggregate, ThingyId, TestEventV2>;

                yield return(testEvent2 == null
                    ? domainEvent
                    : _domainEventFactory.Upgrade <ThingyAggregate, ThingyId>(domainEvent, new TestEventV3()));
            }
            public IEnumerable <IDomainEvent <TestAggregate, TestId> > Upgrade(IDomainEvent <TestAggregate, TestId> domainEvent)
            {
                var testEvent1 = domainEvent as IDomainEvent <TestAggregate, TestId, TestEventV1>;

                yield return(testEvent1 == null
                    ? domainEvent
                    : _domainEventFactory.Upgrade <TestAggregate, TestId>(domainEvent, new TestEventV2()));
            }
Esempio n. 3
0
            public IEnumerable <IDomainEvent <UpgradeAggregate, UpgradeId> > Upgrade(
                IDomainEvent <UpgradeAggregate, UpgradeId> domainEvent)
            {
                var v1 = domainEvent as IDomainEvent <UpgradeAggregate, UpgradeId, UpgradeEventV1>;

                yield return(v1 == null
                    ? domainEvent
                    : _domainEventFactory.Upgrade <UpgradeAggregate, UpgradeId>(domainEvent, new UpgradeEventV2()));
            }