In Startup.ConfigureServices
, I have this piece of code:
services.AddSingleton<IControllerActivator>(new LicenseKeyControllerActivator(keyService));
LicenseKeyControllerActivator looks like this:
public class LicenseKeyControllerActivator
: IControllerActivator
{
private readonly ILicenseKeyService _keyService;
public LicenseKeyControllerActivator(ILicenseKeyService licenseKeyService)
{
_keyService = licenseKeyService;
}
public object Create(ControllerContext context)
{
return new LicenseController(_keyService);
}
public void Release(ControllerContext context, object controller)
{
return;
}
}
During the request-response lifecycle, the activator creates the controller, the DataAnnotations
-based validations work, the filters filter, but no controller method is ever called. In fact, after the set
is called on the DTO, Release
is called immediately.
I'm not sure if this is a routing problem, or a controller activator issue.