public static IEnumerable <IEventHandler <TEvent> > GetEventHandlers <TEvent>(this IHandlerRegistry handlerRegistry) where TEvent : IEvent => handlerRegistry.GetEventHandlers(typeof(TEvent)).Cast <IEventHandler <TEvent> >();