2013-12-07 10:52:38 -05:00
|
|
|
|
using MediaBrowser.Common;
|
|
|
|
|
|
using ServiceStack.Configuration;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.HttpServer
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Class ContainerAdapter
|
|
|
|
|
|
/// </summary>
|
2016-11-08 13:44:23 -05:00
|
|
|
|
class ContainerAdapter : IContainerAdapter
|
2013-12-07 10:52:38 -05:00
|
|
|
|
{
|
|
|
|
|
|
/// <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>();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|