J'utilise signalR pour créer un site Web en temps réel. J'ai 2 hub:Héritage de concentrateur dans Signalr dans ASP.NET Framework
- NotificationHubCore
- NotificationHub (hérite NotificationHubCore)
Ma solution comprend 2 petits projets: Domaine & Web. Je mets NotificationHubCore dans le domaine, NotificationHub dans Web. Maintenant
, dans la section Web, je veux acess NotificationHubCore en utilisant:
GlobalHost.ConnectionManager.GetHubContext<NotificationHubCore>();
Il retourne toujours null pour moi.
Ma question est: comment puis-je accéder à NotificationHubCore via NotificationHub.
J'ai essayé:
var notificationHub = new NotificationHub();
GlobalHost.DependencyResolver.Register(typeof(NotificationHubCore),() => notificationHub);
Mais cette solution ne fonctionne pas.
Quelqu'un peut-il m'aider s'il vous plaît?
Merci,