Castle Windsor intercept method call from within the class

后端 未结 5 1795
予麋鹿
予麋鹿 2020-12-17 05:47

We have components registrations in Castle Windsor container like so

void RegisterComponent() {
    var component = Compon         


        
5条回答
  •  情深已故
    2020-12-17 06:31

    Change your registration to the following and Windsor should switch to class proxies - i.e. using inheritance for interception, instead of composition.

    void RegisterComponent() {
        container.Register(Component.For().ImplementedBy().Interceptors());
    }
    

提交回复
热议问题