2011-10-13 45 views
0

在MEF處理MEF之前,是否可以攔截MEF中的依賴關係請求?攔截MEF中的依賴關係

這對於實現裝飾器和高級生命週期管理很有用。

喜歡的東西...

catalogue.AddInterceptor<IExpensiveService>(b => ... return from pool ...); 

甚至......

catalogue.AddInterceptor<IExpensiveService>(b => new Decorator(b())); 

(其中 'B' 是解決服務的底層MEF分辨率FUNC)

回答