InjectionConstructor with dependent objects

Jul 27, 2010 at 8:54 PM

If I have a constructor in a class with multiple constructor overloads that looks like

Foo(int number, MyDependentObject)

and I want to use InjectionConstructor in the registerType call to tell it to use the above constructor with a number of 42:

.RegisterType(typeof(IFoo<>), typeof(Foo<>), new InjectionConstructor(42, ??? ));

How do I do it? i.e. what do I put in as the second parameter?

Jul 27, 2010 at 10:11 PM

Nevermind...

 

.RegisterType(typeof(IFoo<>), typeof(Foo<>), new InjectionConstructor(42, new ResolvedParameter(typeof(MyDependentObject)) ));