mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Fixed ninject 2 reference
Fixed Core.Test reference to Signalr
This commit is contained in:
parent
8be47a128c
commit
5a1039ed8d
51 changed files with 44 additions and 109593 deletions
34
NzbDrone.Core/NinjectDependencyResolver.cs
Normal file
34
NzbDrone.Core/NinjectDependencyResolver.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue