mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 10:32:35 +01:00
5a1039ed8d
Fixed Core.Test reference to Signalr
35 lines
843 B
C#
35 lines
843 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Ninject;
|
|
using SignalR;
|
|
|
|
namespace NzbDrone.Core
|
|
{
|
|
public class NinjectDependencyResolver : DefaultDependencyResolver
|
|
{
|
|
private readonly IKernel _kernel;
|
|
|
|
public NinjectDependencyResolver(IKernel kernel)
|
|
{
|
|
if (kernel == null)
|
|
{
|
|
throw new ArgumentNullException("kernel");
|
|
}
|
|
|
|
_kernel = kernel;
|
|
}
|
|
|
|
public override object GetService(Type serviceType)
|
|
{
|
|
return _kernel.TryGet(serviceType) ?? base.GetService(serviceType);
|
|
}
|
|
|
|
public override IEnumerable<object> GetServices(Type serviceType)
|
|
{
|
|
return _kernel.GetAll(serviceType).Concat(base.GetServices(serviceType));
|
|
}
|
|
}
|
|
}
|