views:

36

answers:

1

On an asp.net mvc 2 app, I'm using Unity 2.0 interception app for various types of logging where every log entry requires the id of the current user. Currently I'm passing the User object as an argument to service and repository methods. The only reason I'm doing this is so that it's available on MethodInvocation.Argumants for the intercepted method. Ideally, I'd like to supply the interceptor with a User object somehow. This doesn't seem to be possible. Does anybody know if it is or if any other .net AOP tool provides this? I also remember this being a problem several years ago on a project using Spring/Java so I guess it is a common problem that hopefully someone has solved?

A: 

I worked it out. To handle the intercepted calls, you have to supply an implementation of ICallHandler. Add a User parameter to the implementation's constructor.

Andy Chevin