1
比方說,我有一種類型是這樣的:使用多個代理生成掛鉤創建代理
public class Foo
{
public virtual void InterceptedByA() { }
public virtual void InterceptedByB() { }
}
我有兩個選擇名爲InterceptorA
和InterceptorB.
我想使用多個IProxyGenerationHook
實施,以確保他們只截取自己方法。 ProxyGenerator
類接受攔截器組成的數組,但我只能在ProxyGenerationOptions
構造函數使用單IProxyGenerationHook
例如:
var options = new ProxyGenerationOptions(new ProxyGenerationHookForA());
是否有使用多個IProxyGenerationHook
實現創建代理的方式?