diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-24 16:53:54 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-24 16:53:54 -0500 |
| commit | 8ce3e74e8112a94773df22827849bf274fc88198 (patch) | |
| tree | a4ce1edf34466be697e2e432609f6be80b6c6df6 /MediaBrowser.Api/LibraryService.cs | |
| parent | 6c86721f6de2acbe68e9419064ff21111ff3a223 (diff) | |
More DI
Diffstat (limited to 'MediaBrowser.Api/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/LibraryService.cs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index 4ca073c10..434b04eff 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Net; +using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; @@ -98,6 +99,26 @@ namespace MediaBrowser.Api public class LibraryService : BaseRestService { /// <summary> + /// The _app host + /// </summary> + private readonly IApplicationHost _appHost; + + /// <summary> + /// Initializes a new instance of the <see cref="LibraryService" /> class. + /// </summary> + /// <param name="appHost">The app host.</param> + /// <exception cref="System.ArgumentNullException">appHost</exception> + public LibraryService(IApplicationHost appHost) + { + if (appHost == null) + { + throw new ArgumentNullException("appHost"); + } + + _appHost = appHost; + } + + /// <summary> /// Gets the specified request. /// </summary> /// <param name="request">The request.</param> @@ -210,7 +231,7 @@ namespace MediaBrowser.Api { var kernel = (Kernel)Kernel; - var allTypes = kernel.AllTypes.Where(t => !t.IsAbstract && t.IsSubclassOf(typeof(BaseItem))); + var allTypes = _appHost.AllConcreteTypes.Where(t => t.IsSubclassOf(typeof(BaseItem))); if (request.HasInternetProvider) { |
