To know is the object 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
0:23 UTC
Read the original article
Hit count: 481
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