public EventUnhandledException(Type handlerType, IAggregateRootEvent evt, Type listenedFor)
            : base(
  @"{0} does not handle nor ignore incoming event {1} matching listened for type {2}
It should either listen for more specific events or call IgnoreUnHandled".FormatWith(handlerType, evt.GetType(), listenedFor))
        {
            
        }
Пример #2
0
 public void MigrateEvent(IAggregateRootEvent @event, IEventModifier modifier)
 {
     if (@event.GetType() == typeof(TEvent))
     {
         modifier.Replace(_replaceWith.Select(Activator.CreateInstance).Cast <AggregateRootEvent>().ToArray());
     }
 }
Пример #3
0
            public void MigrateEvent(IAggregateRootEvent @event, IEventModifier modifier)
            {
                if (@event.GetType() == typeof(TEvent) && _lastSeenEventType != _insert.Last())
                {
                    modifier.InsertBefore(_insert.Select(Activator.CreateInstance).Cast <AggregateRootEvent>().ToArray());
                }

                _lastSeenEventType = @event.GetType();
            }
Пример #4
0
 public RegisteredHandlerMissingException(Type handlerType, IAggregateRootEvent evt, Type applyAs)
     : base(
         // ReSharper disable FormatStringProblem
         @"{0} does not have a registered handler action for incoming event {1} being handled as {2}. " +
         "Add one in the constructor for the AggregateRootEntity by calling " +
         "Register(Handler.For<{1}>().OnApply(e => {{}})".FormatWith(handlerType, evt.GetType(), applyAs))
     // ReSharper restore FormatStringProblem
 {
 }
 private SingleAggregateInstanceEventStreamMutator
     (IAggregateRootEvent creationEvent, IEnumerable<IEventMigration> eventMigrations, Action<IReadOnlyList<AggregateRootEvent>> eventsAddedCallback)
 {
     _eventModifier = new EventModifier(eventsAddedCallback ?? (_ => { }));
     _aggregateId = creationEvent.AggregateRootId;
     _eventMigrators = eventMigrations
         .Where(migration => migration.MigratedAggregateEventHierarchyRootInterface.IsInstanceOfType(creationEvent))
         .Select(migration => migration.CreateSingleAggregateInstanceHandlingMigrator())
         .ToArray();
 }
Пример #6
0
 private SingleAggregateInstanceEventStreamMutator
     (IAggregateRootEvent creationEvent, IEnumerable <IEventMigration> eventMigrations, Action <IReadOnlyList <AggregateRootEvent> > eventsAddedCallback)
 {
     _eventModifier  = new EventModifier(eventsAddedCallback ?? (_ => { }));
     _aggregateId    = creationEvent.AggregateRootId;
     _eventMigrators = eventMigrations
                       .Where(migration => migration.MigratedAggregateEventHierarchyRootInterface.IsInstanceOfType(creationEvent))
                       .Select(migration => migration.CreateSingleAggregateInstanceHandlingMigrator())
                       .ToArray();
 }
Пример #7
0
 void ISharedOwnershipAggregateRoot.IntegrateExternallyRaisedEvent(IAggregateRootEvent theEvent)
 {
     RaiseEvent((TAggregateRootBaseEventClass)theEvent);
 }
 public static ISingleAggregateInstanceEventStreamMutator Create(IAggregateRootEvent creationEvent, IReadOnlyList<IEventMigration> eventMigrations, Action<IReadOnlyList<AggregateRootEvent>> eventsAddedCallback = null)
 {
     return new SingleAggregateInstanceEventStreamMutator(creationEvent, eventMigrations, eventsAddedCallback);
 }
Пример #9
0
        public EventUnhandledException(Type handlerType, IAggregateRootEvent evt, Type listenedFor)
            : base(
                @"{0} does not handle nor ignore incoming event {1} matching listened for type {2}
It should either listen for more specific events or call IgnoreUnHandled".FormatWith(handlerType, evt.GetType(), listenedFor))
        {
        }
Пример #10
0
 public static ISingleAggregateInstanceEventStreamMutator Create(IAggregateRootEvent creationEvent, IReadOnlyList <IEventMigration> eventMigrations, Action <IReadOnlyList <AggregateRootEvent> > eventsAddedCallback = null)
 {
     return(new SingleAggregateInstanceEventStreamMutator(creationEvent, eventMigrations, eventsAddedCallback));
 }