mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
fixed some broken tests.
This commit is contained in:
parent
acaa05c9c0
commit
324b5e3b80
19 changed files with 95 additions and 135 deletions
33
NzbDrone.Common/CommonContainerExtentions.cs
Normal file
33
NzbDrone.Common/CommonContainerExtentions.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Autofac;
|
||||
|
||||
namespace NzbDrone.Common
|
||||
{
|
||||
public static class CommonContainerExtensions
|
||||
{
|
||||
public static void RegisterCommonServices(this ContainerBuilder containerBuilder)
|
||||
{
|
||||
containerBuilder.RegisterAssemblyTypes("NzbDrone.Common");
|
||||
}
|
||||
|
||||
public static void RegisterAssemblyTypes(this ContainerBuilder containerBuilder, string assemblyName)
|
||||
{
|
||||
var apiAssembly = Assembly.Load(assemblyName);
|
||||
|
||||
if (apiAssembly == null)
|
||||
{
|
||||
throw new ApplicationException("Couldn't load assembly " + assemblyName);
|
||||
}
|
||||
|
||||
containerBuilder.RegisterAssemblyTypes(apiAssembly)
|
||||
.AsImplementedInterfaces()
|
||||
.SingleInstance();
|
||||
|
||||
containerBuilder.RegisterAssemblyTypes(apiAssembly)
|
||||
.AsSelf()
|
||||
.SingleInstance();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue