Castle.Core.AsyncInterceptor
Castle.Core.AsyncInterceptor copied to clipboard
How to register interfaces in batches
I have many interfaces how to register in batches, for example, I want to register all warehouse interfaces.
inherit AsyncInterceptorBase or IAsyncInterceptor ,can not be used .EnableInterfaceInterceptors().InterceptedBy(typeof(TransactionalInterceptor))
var myClass = new ClasThatImplementsIMyInterface();
var generator = new ProxyGenerator();
var interceptor = new ClasThatExtendsAsyncInterceptorBase();
IMyInterface proxy = generator.CreateInterfaceProxyWithTargetInterface<IMyInterface>(myClass, interceptor)