You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using exception filters, the ones registered with override are executed last not first, which is the opposite compared to action filters. The documentation sounds like it should be the same order no matter what type of interface you implement so it would seem like a bug.
When I do something very similar above, but with IAutofacContinuationActionFilter instead of IAutofacExceptionFilter (and changing registration to use AsWebApiActionFilter... I get the following printed in order
Interesting. Sounds like something to address if it's inconsistent with the action filter ordering.
I will say it's odd that you're registering overrides before registering the things to override. Registration order has always been important in DI. If you register them in the order of "not overrides" and then "overrides" what happens?
And, just to verify, if you do this same thing with action filters it provides the expected order?
Describe the Bug
When using exception filters, the ones registered with override are executed last not first, which is the opposite compared to action filters. The documentation sounds like it should be the same order no matter what type of interface you implement so it would seem like a bug.
Steps to Reproduce
Expected Behavior
When I do something very similar above, but with IAutofacContinuationActionFilter instead of IAutofacExceptionFilter (and changing registration to use AsWebApiActionFilter... I get the following printed in order
E1 - continue
E2 - continue
E3 - continue
E4 - continue
But when I run the code above I get this printed in order:
E3-exception
E4-exception
E1-exception
E2-exception
which means the override ones are executed last, not first.
Dependency Versions
Autofac.WebApi2 6.0.1
Autofac 6.2.0
The text was updated successfully, but these errors were encountered: