Skip to content
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

Creating an Interceptor Class with a DI Dependency #7

Open
dguinn-oncore opened this issue Nov 15, 2016 · 2 comments
Open

Creating an Interceptor Class with a DI Dependency #7

dguinn-oncore opened this issue Nov 15, 2016 · 2 comments

Comments

@dguinn-oncore
Copy link

Hey guys, this is a really great addition for structure map!

I may be missing something simple, but I can't figure out how to add an IAsyncInterceptionBehavior that requires a constructor dependency (ILogger, for example). Logging is a good example because I think that is pretty common use for dynamic proxy interception (with tracing and error handling).

Let me know if something comes to mind, or if I'm missing something pretty obvious!

Thanks!

@DixonDs
Copy link
Member

DixonDs commented Dec 28, 2016

@dguinn-oncore Have you tried to use DynamicProxyInterceptor(params Type[] interceptionBehaviorTypes) ctor? If you have, let's say, LoggingInterceptionBehavior with ILogger dependency, it should work if you create use new DynamicProxyInterceptor(typeof(LoggingInterceptionBehavior))

@mattiasnordqvist
Copy link

did this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants