-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support method level interception #80
Comments
Could you provide an example of what you'd like to do, maybe a code snippet/pseudocode. My understanding of your request is currently what you do today with Castle DynamicProxy and/or Castle Windsor. Take a look at the DynamicProxy Introduction. |
Right, so what im trying to do is create an interceptor which will be able to intercept at the method level, for example. Lets say i have class Foo with two methods:
I want to intercept only calls on Foo that have a LogAttribute. I don't want the entire class to be intercepted, but only specific methods. Hope that's clearer. I came across this SO question: http://stackoverflow.com/questions/21148285/castle-windsor-interceptor-not-working-with-method-level-attribute which basically says you can't do that. |
A |
Can we close this issue? It looks like it's been resolved... |
Let us know if |
I've been searching around to see if it is possible to use interceptors for method level interception, and came across the following from the docs:
"The InterceptorAttribute is defined in a way that allows you to put it not only on classes, but on any other target where custom attribute is allowed, like interface or a method. However Windsor will ignore the attribute unless it's on component's implementation class. This permissive behavior was introduced to allow people to add support for other targets by building custom extensions."
I think adding a fine grained control for interception at the method level would be a great thing for general purpose aspects such as logging, performance counters, etc.
The text was updated successfully, but these errors were encountered: