1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-15 07:22:35 +01:00
Radarr/NzbDrone.Host/Owin/OwinServiceProvider.cs

25 lines
645 B
C#
Raw Normal View History

using System;
using Microsoft.Owin.Hosting.Services;
using Microsoft.Owin.Hosting.Tracing;
namespace NzbDrone.Host.Owin
{
public class OwinServiceProvider : IServiceProvider
{
private readonly IServiceProvider _defaultProvider;
public OwinServiceProvider()
{
_defaultProvider = ServicesFactory.Create();
}
public object GetService(Type serviceType)
{
if (serviceType == typeof (ITraceOutputFactory))
{
return new OwinTraceOutputFactory();
}
return _defaultProvider.GetService(serviceType);
}
}
}