type discovery without attributes

This commit is contained in:
LukePulverenti
2013-02-23 02:57:11 -05:00
parent c165f37bb9
commit b8d5c71842
121 changed files with 780 additions and 512 deletions

View File

@@ -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>();
}
}
}