mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
parent
a1581477b8
commit
d34b527842
10 changed files with 36 additions and 39 deletions
|
@ -20,6 +20,15 @@ namespace NzbDrone.Api
|
|||
return this.ApplicationContainer.Resolve<INancyEngine>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the moduleKey generator
|
||||
/// </summary>
|
||||
/// <returns>IModuleKeyGenerator instance</returns>
|
||||
protected override sealed IModuleKeyGenerator GetModuleKeyGenerator()
|
||||
{
|
||||
return this.ApplicationContainer.Resolve<IModuleKeyGenerator>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a default, unconfigured, container
|
||||
/// </summary>
|
||||
|
@ -79,8 +88,8 @@ namespace NzbDrone.Api
|
|||
container.Register(
|
||||
typeof(INancyModule),
|
||||
moduleRegistrationType.ModuleType,
|
||||
moduleRegistrationType.ModuleType.FullName).
|
||||
AsSingleton();
|
||||
moduleRegistrationType.ModuleKey).
|
||||
AsSingleton();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,14 +156,14 @@ namespace NzbDrone.Api
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retreive a specific module instance from the container
|
||||
/// Retreive a specific module instance from the container by its key
|
||||
/// </summary>
|
||||
/// <param name="container">Container to use</param>
|
||||
/// <param name="moduleType">Type of the module</param>
|
||||
/// <param name="moduleKey">Module key of the module</param>
|
||||
/// <returns>NancyModule instance</returns>
|
||||
protected override sealed INancyModule GetModule(TinyIoCContainer container, Type moduleType)
|
||||
protected override sealed INancyModule GetModuleByKey(TinyIoCContainer container, string moduleKey)
|
||||
{
|
||||
return (INancyModule)container.Resolve(moduleType);
|
||||
return container.Resolve<INancyModule>(moduleKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue