Does Ninject automatically inject non-bound classes?

In Ninject V1, ImplicitSelfBinding was a top-level config setting (which defaulted to true IIRC). In V2, the implicit self binding behavior you observe is more deeply wired in (though there are ways of switching it off -- like most bits of Ninject, it's very granular and minimal). In V2, the default behavior is that self-bindings are always generated if no other binding is present.

The only time you typically do a Bind().ToSelf() is to customise the binding, e.g. , to do a . InSingletonScope(). Go do a grep in the source right now for ImplicitSelfBinding this instant - it's far easier to read than people rabbiting on though!

Also don't forget to have a look at the scannning extensions and tests on ninject. Org for arranging implicit Bind()ing of I*X* to *X* (As Steven alluded to, Ninject would not self bind if you changed your MyClass class to be abstract.).

In Ninject V1, ImplicitSelfBinding was a top-level config setting (which defaulted to true IIRC).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions