I have something like this:
class Root { public Root(IDependency dep) {} } class Dependency:IDependency { public Dependency(int val) {} }
And I'm trying to get a link to Root using ninject. Therefore, I configure it this way
var module = new InlineModule(mod => mod.Bind<IDependency>().To<Dependency>()); var kernel = new StandardKernel(module);
I would like to introduce the Dependency value of some val value, which is known only at the moment of receiving the Root link from ninject.
What I would like to do is something like this:
Kernel.Instance.Get<Root>(With.Parameters.ConstructorArgument("val", 12));
Is this possible using ninject 1.0?
dependency-injection ninject
Silviu Jan 28 '10 at 10:30 2010-01-28 10:30
source share