OOTB, Ninject (esp. v2 - in v1, it was an optional setting that defaulted to on) internally generates implicit bindings for concrete classes to themselves, with the default scoping (Transient in v2). These registrations get added into the Bindings list as if you'd added them yourself via.
Bind<ConcreteClass>().ToSelf(); // .InTransientScope(); -- But that would be implicit
If you need anything different in your binding, you register a Bind
ing before it gets auto-bound, with Your customisation bit a la:
Bind<ConcreteClass>().ToSelf().<<Your Customisation Bit>>;
In this case, your remedy is to use something like:
Bind<ConcreteClass>().ToSelf().InSingletonScope().WithConstructorArgument( "foo", "bar");
Where InSingletonScope()
would match your current code in that it looks like you only ever want to instantiate one. In general, as covered in other answers, one shouldnt necessarily grab for InSingletonScope
as a tool of first resort.