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)) { }
public void MigrateEvent(IAggregateRootEvent @event, IEventModifier modifier) { if (@event.GetType() == typeof(TEvent)) { modifier.Replace(_replaceWith.Select(Activator.CreateInstance).Cast <AggregateRootEvent>().ToArray()); } }
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(); }
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(); }
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(); }
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); }
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)) { }
public static ISingleAggregateInstanceEventStreamMutator Create(IAggregateRootEvent creationEvent, IReadOnlyList <IEventMigration> eventMigrations, Action <IReadOnlyList <AggregateRootEvent> > eventsAddedCallback = null) { return(new SingleAggregateInstanceEventStreamMutator(creationEvent, eventMigrations, eventsAddedCallback)); }