-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Labels
Description
I have two filters set on two different base classes. I then have a controller (PersController) that derives from both of them.
containerBuilder.RegisterType<ExceptionFilter>()
.As<IAutofacExceptionFilter>()
.AsWebApiExceptionFilterFor<ApiController>()
.InstancePerRequest();
containerBuilder.RegisterType<AuthenticationFilter>()
.As<IAutofacAuthenticationFilter>()
.AsWebApiAuthenticationFilterFor<AuthenticationControllerBase>()
.InstancePerRequest();
public class PersController : AuthenticationControllerBase
{
}
public abstract class AuthenticationControllerBase : ApiController
{
}
With latest version (v4.3.0), if I call an API in PersController, I don't see either of these filters run. In version v4.2.1, this worked.
If I change the registration to the following, then it works:
containerBuilder.RegisterType<ExceptionFilter>()
.As<IAutofacExceptionFilter>()
.AsWebApiExceptionFilterFor<PersController>()
.InstancePerRequest();
containerBuilder.RegisterType<AuthenticationFilter>()
.As<IAutofacAuthenticationFilter>()
.AsWebApiAuthenticationFilterFor<PersController>()
.InstancePerRequest();
This is a huge change and I assume that this is a bug, not that this was an intended change.
TheNephalim