From b8d5c718429f1325111834b8b95698fc9c9ba47d Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sat, 23 Feb 2013 02:57:11 -0500 Subject: type discovery without attributes --- MediaBrowser.Common/Net/HttpServer.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'MediaBrowser.Common/Net/HttpServer.cs') 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 /// The endpoint. public IPEndPoint Endpoint { get; set; } } + + class ContainerAdapter : IContainerAdapter + { + private readonly IApplicationHost _appHost; + + public ContainerAdapter(IApplicationHost appHost) + { + _appHost = appHost; + } + public T Resolve() + { + return _appHost.Resolve(); + } + + public T TryResolve() + { + return _appHost.TryResolve(); + } + } } \ No newline at end of file -- cgit v1.2.3