mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
5a1039ed8d
Fixed Core.Test reference to Signalr
34 lines
843 B
C#
34 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));
|
|
}
|
|
}
|
|
}
|