public void Publish <TNotification>(TNotification notification) where TNotification : INotification { var handlers = _handlerFactory.CreateAll <INotificationHandler <TNotification> >(); foreach (var handler in handlers) { handler.Handle(notification); } }