How to get if the object is already retrieved in inject

Posted by zerkms on Stack Overflow See other posts from Stack Overflow or by zerkms
Published on 2010-06-02T00:15:20Z Indexed on 2010/06/02 23:34 UTC
Read the original article Hit count: 165

Filed under:
|
|
|

Is it possible to know that particular dependency already has been satisfied by ninject kernel? To be clear:

Let's suppose we have this module:

Bind<IA>().To<A>();
Bind<IB>().To<B>();

And some "client"-code:

var a = kernel.Get<IA>();

// how to get here "true" for assumption: "IA was requested (once)"
// and "false" for: "IB was not requested ever"

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET