Brilliant thanks! It has all fallen into place now.

I can cache the attributes for every method from the ComponentModel in a 
dictionary using the MethodInfo as the key, and then retrieve them from the 
cache using invocation.Method when the interceptor is called.

I am of course hoping that MethodInfo behaves nicely as a key in a 
dictionary. Not tested it yet :)



On Thursday, August 9, 2018 at 2:03:58 PM UTC+1, Krzysztof Koźmic wrote:
>
> The ComponentModel will give your interceptor the information about the 
> component so you can pre-cache whatever information you need to extract 
> from the attributes (componentModel.Implementation will give you the 
> type).
>
> Then in the Intercept you can quickly look that data up. It's a 
> performance optimisation. IIRC you'll get an interceptor instance per 
> component instance, not per method, so one interceptor will apply to all 
> methods on an instance (unless you exclude it with IInterceptorSelector).
>
> Hope that makes sense
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at https://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to