public static IEnumerable <T> Handle <T>(IEvent @event, ReadOnlyCollection <ResolvedEvent> eventStream, Microsoft.Extensions.Logging.ILogger log) { var pumps = EoRegistry.GetEventPumps(@event); foreach (var pump in pumps) { var eventPump = pump; var context = CommonUtils.LoadContext(@event, eventPump.ContextLoader, eventStream, log); foreach (var result in Process <T>(@event, context, (IEventProcessor)eventPump.Processor, log)) { yield return(result); } } }
public static IEnumerable <ICommand> Handle(INotification notification, ReadOnlyCollection <ResolvedEvent> eventStream, Microsoft.Extensions.Logging.ILogger log) { var pumps = EoRegistry.GetNotificationPumps(notification); foreach (var pump in pumps) { var notificationPump = pump; var context = CommonUtils.LoadContext(notification, notificationPump.ContextLoader, eventStream, log); foreach (var result in Process(notification, context, (INotificationProcessor)notificationPump.Processor, log)) { yield return(result); } } }