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

Wrong interceptor is chosen when multiple bindings exist #26

Closed
orient-man opened this issue Jan 13, 2014 · 6 comments
Closed

Wrong interceptor is chosen when multiple bindings exist #26

orient-man opened this issue Jan 13, 2014 · 6 comments
Assignees

Comments

@orient-man
Copy link

Here is an example:

https://gist.github.com/orient-man/8400383

I expect result to be multiplied by 100 but the first interceptor is chosen.

@BrunoJuchli
Copy link

Remark: The issue is not dependent on using DynamicProxy or Linfu ninject extension.

@orient-man
Copy link
Author

Thank you!

@grofit
Copy link

grofit commented Oct 27, 2017

Not sure if this is related but if I use attribute based interception and have multiple implementations for the same interface it seems to apply ones from one implementation to another.

i.e

public class SomethingOne : ISomething
{
   [SayHello]
   public virtual void DoSomething();
}

public class SomethingTwo : ISomething
{
   public virtual void DoSomething();
}

Bind<ISomething>().To<SomethingOne>();
Bind<ISomething>().To<SomethingTwo>();

If I were to inject in a list of ISomething to a class, and get the SomethingTwo out of it and call DoSomething it calls the SayHello related interceptor, when one is not applied to that implementation.

@scott-xu scott-xu self-assigned this Oct 28, 2017
@scott-xu scott-xu reopened this Oct 28, 2017
@grofit
Copy link

grofit commented Oct 28, 2017

Thanks guys

@grofit
Copy link

grofit commented Nov 1, 2017

@scott-xu is this fix due to be released to nuget soon?

@scott-xu
Copy link
Member

scott-xu commented Nov 1, 2017

Released just now.

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

4 participants