mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
all services are singleton by default.
This commit is contained in:
parent
8bdf8c31f0
commit
763df726f0
12 changed files with 5 additions and 34 deletions
|
@ -64,22 +64,12 @@ namespace NzbDrone.Common.Composition
|
|||
var impl = implementations.Single();
|
||||
|
||||
Trace.WriteLine(string.Format("Registering {0} -> {1}", contractType.FullName, impl.Name));
|
||||
|
||||
|
||||
if (impl.HasAttribute<SingletonAttribute>())
|
||||
{
|
||||
Container.RegisterSingleton(contractType, impl);
|
||||
}
|
||||
else
|
||||
{
|
||||
Container.Register(contractType, impl);
|
||||
}
|
||||
Container.RegisterSingleton(contractType, impl);
|
||||
}
|
||||
else
|
||||
{
|
||||
Trace.WriteLine(string.Format("Registering {0} -> {1}", contractType.FullName, implementations.Count));
|
||||
|
||||
Container.RegisterAll(contractType, implementations);
|
||||
Container.RegisterAllAsSingleton(contractType, implementations);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue