From d8957a85ef8d0ac1805762120367945b287de405 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 12 Feb 2012 17:07:09 -0800 Subject: [PATCH] Small tweak in SignalR dependency injection. --- NzbDrone.Core/CentralDispatch.cs | 9 ++++++++- NzbDrone.Core/Providers/SignalRProvider.cs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index 9d4099121..e1d474ffa 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -6,7 +6,6 @@ using Ninject; using NLog; using NzbDrone.Common; -using NzbDrone.Core.Datastore; using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Jobs; using NzbDrone.Core.Providers; @@ -14,6 +13,11 @@ using NzbDrone.Core.Providers.ExternalNotification; using NzbDrone.Core.Providers.Indexer; using PetaPoco; +using SignalR; +using SignalR.Hosting.AspNet; +using SignalR.Infrastructure; +using SignalR.Ninject; +using Connection = NzbDrone.Core.Datastore.Connection; namespace NzbDrone.Core { @@ -31,6 +35,9 @@ public CentralDispatch() logger.Debug("Initializing Kernel:"); Kernel = new StandardKernel(); + var resolver = new NinjectDependencyResolver(Kernel); + AspNetHost.SetResolver(resolver); + InitDatabase(); InitReporting(); diff --git a/NzbDrone.Core/Providers/SignalRProvider.cs b/NzbDrone.Core/Providers/SignalRProvider.cs index 628646de4..aac95512a 100644 --- a/NzbDrone.Core/Providers/SignalRProvider.cs +++ b/NzbDrone.Core/Providers/SignalRProvider.cs @@ -22,7 +22,7 @@ public virtual void UpdateEpisodeStatus(int episodeId, EpisodeStatusType episode GetClients().updatedStatus(episodeId, episodeStatus.ToString()); } - private static dynamic GetClients() + private dynamic GetClients() { var connectionManager = AspNetHost.DependencyResolver.Resolve(); return connectionManager.GetClients();