Control the order Interceptors are executed
How can I manage in what order Interceptors ar开发者_运维技巧e executed?
I would like to have a general exception interceptor outermost.
Use .First
, .Last
or .AtIndex()
to control interceptor ordering when declaring the interceptor reference, e.g.:
container.Register(
Component.For<ISomething>()
.ImplementedBy<Something>()
.Interceptors(InterceptorReference.ForKey("myinterceptor")).Last);
Or use .Anywhere
if you don't care about ordering.
精彩评论