使用LinFu生成动态代理

Rau*_*otz 1 c# proxy dynamic linfu

我正在尝试为LinFu的接口构建动态代理.代理应该只实现接口定义的属性的getter方法,并返回例如字典中的值,其中键是属性名称.

链接文字

pla*_*ano 5

尝试:

// The interceptor class must implement the IInterceptor interface
var yourInterceptor = new YourInterceptor();
var proxyFactory = new ProxyFactory();
IYourInterface proxy = proxyFactory.CreateProxy<IYourInterface>(yourInterceptor);
// Do something useful with the proxy here...
Run Code Online (Sandbox Code Playgroud)