Is it possible to configure Ninject to not bind a dependency if it is already bound.
eg.
If we load a module called Client1, containing:
public class Client1Module:NinjectModule { public override void Load() { Bind<IService>.To<FancyService>() } }
Then load the module called Base, containing
public class BaseModule:NinjectModule { public override void Load() { Bind<IService>.To<BasicService>() } }
We would like to guarantee that BasicService is not connected and the system always uses FancyService. During development, we will not know if a FancyService exists. Client1 module is loaded if it is located.
I really don't want every injection to have a bunch of repeating boiler plate code. Like 50-60 dependencies, everything can be changed in client modules.
Any ideas?
Graememiller
source share