aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Net/HttpServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common/Net/HttpServer.cs')
-rw-r--r--MediaBrowser.Common/Net/HttpServer.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Net/HttpServer.cs b/MediaBrowser.Common/Net/HttpServer.cs
index b09c95da0..20ee615ad 100644
--- a/MediaBrowser.Common/Net/HttpServer.cs
+++ b/MediaBrowser.Common/Net/HttpServer.cs
@@ -4,6 +4,7 @@ using MediaBrowser.Common.Kernel;
using MediaBrowser.Model.Logging;
using ServiceStack.Api.Swagger;
using ServiceStack.Common.Web;
+using ServiceStack.Configuration;
using ServiceStack.Logging.NLogger;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface.Cors;
@@ -153,6 +154,8 @@ namespace MediaBrowser.Common.Net
DebugMode = true
});
}
+
+ container.Adapter = new ContainerAdapter(ApplicationHost);
container.Register(Kernel);
container.Register(_logger);
@@ -464,4 +467,23 @@ namespace MediaBrowser.Common.Net
/// <value>The endpoint.</value>
public IPEndPoint Endpoint { get; set; }
}
+
+ class ContainerAdapter : IContainerAdapter
+ {
+ private readonly IApplicationHost _appHost;
+
+ public ContainerAdapter(IApplicationHost appHost)
+ {
+ _appHost = appHost;
+ }
+ public T Resolve<T>()
+ {
+ return _appHost.Resolve<T>();
+ }
+
+ public T TryResolve<T>()
+ {
+ return _appHost.TryResolve<T>();
+ }
+ }
} \ No newline at end of file