I\'m having something like this:
class Root
{
public Root(IDependency dep)
{}
}
class Dependency:IDependency
With Ninject 3 IParameter
s (ConstructorArgument
is one of them) will now simply be "inherited" to child request when they have ShouldInherit == true
(see here).
The solution for this question can now be as simple as:
IResolutionRoot.Get(new ConstructorArgument("val", 12, true));
where as the true
in the ConstructorArgument
s constructor sets ShouldInherit
to true
. Also see here