I am trying to build a dynamic proxy for an interface with LinFu. The proxy should just implement the getter methods of the properties that are defined by the interface and return for instance a value from a dictionary, where the key is the property name.
Asked
Active
Viewed 1,668 times
1 Answers
5
Try:
// 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...

Krzysztof Kozmic
- 27,267
- 12
- 73
- 115

plaureano
- 3,139
- 6
- 30
- 29