public void AddRouterFor <TEvent>(IRoute <TEvent> router) { if (!_routers.ContainsKey(typeof(TEvent))) { _routers.Add(typeof(TEvent), new List <Action <object> >()); } _routers[typeof(TEvent)].Add(e => router.Handle((TEvent)e)); _logger.Debug($"Registered router '{router.GetType().Name}' for event type '{typeof(TEvent).Name}'"); }