You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
668 B
27 lines
668 B
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Controllers;
|
|
using NzbDrone.Common.Composition;
|
|
|
|
namespace NzbDrone.Host
|
|
{
|
|
public class ControllerActivator : IControllerActivator
|
|
{
|
|
private readonly IContainer _container;
|
|
|
|
public ControllerActivator(IContainer container)
|
|
{
|
|
_container = container;
|
|
}
|
|
|
|
public object Create(ControllerContext context)
|
|
{
|
|
return _container.Resolve(context.ActionDescriptor.ControllerTypeInfo.AsType());
|
|
}
|
|
|
|
public void Release(ControllerContext context, object controller)
|
|
{
|
|
// Nothing to do
|
|
}
|
|
}
|
|
}
|