开发者

Control the order Interceptors are executed

开发者 https://www.devze.com 2023-01-31 15:16 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号