mirror of https://github.com/lidarr/Lidarr
Container Cleanup
This commit is contained in:
parent
68129e3518
commit
abd994ef71
|
@ -24,8 +24,6 @@ namespace NzbDrone.Common.Composition
|
|||
_container.Register<TService, TImplementation>();
|
||||
}
|
||||
|
||||
public TinyIoCContainer TinyContainer { get { return _container; } }
|
||||
|
||||
public void Register<T>(T instance) where T : class
|
||||
{
|
||||
_container.Register<T>(instance);
|
||||
|
@ -51,18 +49,6 @@ namespace NzbDrone.Common.Composition
|
|||
_container.Register((c, n) => factory(this));
|
||||
}
|
||||
|
||||
public void RegisterSingleton<TService, TImplementation>()
|
||||
where TImplementation : class, TService
|
||||
where TService : class
|
||||
{
|
||||
_container.Register<TService, TImplementation>().AsSingleton();
|
||||
}
|
||||
|
||||
public void RegisterSingleton<T>() where T : class
|
||||
{
|
||||
_container.Register<T, T>().AsSingleton();
|
||||
}
|
||||
|
||||
public void RegisterSingleton(Type service, Type implementation)
|
||||
{
|
||||
_container.Register(service, implementation).AsSingleton();
|
||||
|
@ -73,16 +59,6 @@ namespace NzbDrone.Common.Composition
|
|||
return _container.ResolveAll<T>();
|
||||
}
|
||||
|
||||
public IEnumerable<object> ResolveAll(Type type)
|
||||
{
|
||||
return _container.ResolveAll(type);
|
||||
}
|
||||
|
||||
public void Register(Type registrationType, object instance)
|
||||
{
|
||||
_container.Register(registrationType, instance);
|
||||
}
|
||||
|
||||
public void RegisterAllAsSingleton(Type registrationType, IEnumerable<Type> implementationList)
|
||||
{
|
||||
_container.RegisterMultiple(registrationType, implementationList).AsSingleton();
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace NzbDrone.Common.Composition
|
|||
{
|
||||
public interface IContainer
|
||||
{
|
||||
TinyIoCContainer TinyContainer { get; }
|
||||
void Register<T>(T instance) where T : class;
|
||||
|
||||
void Register<TService, TImplementation>()
|
||||
|
@ -16,14 +15,8 @@ namespace NzbDrone.Common.Composition
|
|||
object Resolve(Type type);
|
||||
void Register(Type serviceType, Type implementationType);
|
||||
void Register<TService>(Func<IContainer, TService> factory) where TService : class;
|
||||
void RegisterSingleton<TService, TImplementation>()
|
||||
where TImplementation : class, TService
|
||||
where TService : class;
|
||||
void RegisterSingleton<T>() where T : class;
|
||||
void RegisterSingleton(Type service, Type implementation);
|
||||
IEnumerable<T> ResolveAll<T>() where T : class;
|
||||
IEnumerable<object> ResolveAll(Type type);
|
||||
void Register(Type registrationType, object instance);
|
||||
void RegisterAllAsSingleton(Type registrationType, IEnumerable<Type> implementationList);
|
||||
bool IsTypeRegistered(Type type);
|
||||
|
||||
|
|
Loading…
Reference in New Issue