Easiest way to check if method is auto-implemented by Castle DynamicProxy
I'm looking for the easiest way to check if a开发者_C百科 method on my proxy has been auto-implemented by DynamicProxy. That is, let's say when registering my component, I added some AdditionalInterfaces, and in my interceptor, I only want to intercept the method if that interface was auto-implemented on the proxy and will simply throw a NotImplementedException if I call .Proceed(). I can think of some crude ways to check this using the ComponentModel, but I was hoping there might be something easy/straightforward.
Thanks!
Use IProxyGenerationHook
to only proxy the methods you want to intercept.
精彩评论