diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-07 10:52:38 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-07 10:52:38 -0500 |
| commit | f32212d160f5427a56b5b8e0219206930c518b64 (patch) | |
| tree | eddda40fe8c4d46cd0a0009939607681da89f03c /MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs | |
| parent | 1b1bcabbb12a3ab2c9b8c5b319423eb3860c9987 (diff) | |
update to service stack v4
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/ContainerAdapter.cs | 53 |
1 files changed, 53 insertions, 0 deletions
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 +{ + /// <summary> + /// Class ContainerAdapter + /// </summary> + class ContainerAdapter : IContainerAdapter, IRelease + { + /// <summary> + /// The _app host + /// </summary> + private readonly IApplicationHost _appHost; + + /// <summary> + /// Initializes a new instance of the <see cref="ContainerAdapter" /> class. + /// </summary> + /// <param name="appHost">The app host.</param> + public ContainerAdapter(IApplicationHost appHost) + { + _appHost = appHost; + } + /// <summary> + /// Resolves this instance. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns>``0.</returns> + public T Resolve<T>() + { + return _appHost.Resolve<T>(); + } + + /// <summary> + /// Tries the resolve. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns>``0.</returns> + public T TryResolve<T>() + { + return _appHost.TryResolve<T>(); + } + + /// <summary> + /// Releases the specified instance. + /// </summary> + /// <param name="instance">The instance.</param> + public void Release(object instance) + { + // Leave this empty so SS doesn't try to dispose our objects + } + } +} |
