public void ConsumeEvent(Event @event) { foreach (IEventHandler handler in eventHandlerProvider.GetEventHandlers(@event.GetType())) { handler.When(@event); } }
private void DispatchEvent(Event @event) { foreach (var handler in EventRoutes.Where(x => x.HandlerType == @event.GetType())) { handler.Handle(@event); } }