1

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.

link text

Rauhotz
  • 7,914
  • 6
  • 40
  • 44

1 Answers1

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