From f32212d160f5427a56b5b8e0219206930c518b64 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Dec 2013 10:52:38 -0500 Subject: update to service stack v4 --- .../HttpServer/ContainerAdapter.cs | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs (limited to 'MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs') diff --git a/MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs b/MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs new file mode 100644 index 000000000..93d224b8d --- /dev/null +++ b/MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs @@ -0,0 +1,53 @@ +using MediaBrowser.Common; +using ServiceStack.Configuration; + +namespace MediaBrowser.Server.Implementations.HttpServer +{ + /// + /// Class ContainerAdapter + /// + class ContainerAdapter : IContainerAdapter, IRelease + { + /// + /// The _app host + /// + private readonly IApplicationHost _appHost; + + /// + /// Initializes a new instance of the class. + /// + /// The app host. + public ContainerAdapter(IApplicationHost appHost) + { + _appHost = appHost; + } + /// + /// Resolves this instance. + /// + /// + /// ``0. + public T Resolve() + { + return _appHost.Resolve(); + } + + /// + /// Tries the resolve. + /// + /// + /// ``0. + public T TryResolve() + { + return _appHost.TryResolve(); + } + + /// + /// Releases the specified instance. + /// + /// The instance. + public void Release(object instance) + { + // Leave this empty so SS doesn't try to dispose our objects + } + } +} -- cgit v1.2.3