I have two classes (with similarly named interfaces):
OuterService(IInnerService innerService)
InnerService(string configurationKey)
In my NinjectMvc3 class I have a binding for the IInnerService interface:
kernel.Bind<IInnerService>.ToMethod(c => new InnerService("myConfigurationKey")))
Right now, I am just copying the constructor instantiation for InnerService within the IOuterService binding:
kernel.Bind<IOuterService>.ToMethod(c => new OuterService(new InnerService("myConfigurationKey")))
Is there any way that I could avoid this second InnerService constructor by doing a nested/cascading injection with the IInnerService interface?
// I realize this isn't valid, but it may better clarify my intent:
kernel.Bind<IOuterService>.ToMethod(c => new OuterService(IInnerService))