开发者

Ninject how to check a binding for a given type is available without creating an instance

开发者 https://www.devze.com 2023-02-20 21:26 出处:网络
So I m just trying to test my modules, normally i would go and create a Kernel with the given module and then try to get an instance, however t开发者_开发问答his scenario involves a few modules and it

So I m just trying to test my modules, normally i would go and create a Kernel with the given module and then try to get an instance, however t开发者_开发问答his scenario involves a few modules and it would be nicer if I could check that certain modules have access to certain Bindings (ie that implement and interface)

Is there any way to check if a binding for a given type is available without creating and instance of the class (ie so I don't have to make sure those dependencies are there)?


Damn, of course as soon as I posted I found that in the Kernel, there is a GetBindings() method that does pretty much what I need.

Hope this helps to someone

0

精彩评论

暂无评论...
验证码 换一张
取 消