I have a class with constructor like this:
public class Bar
{
public Bar(IFoo foo, IFoo2 foo2, IFoo3 foo3, IFooN fooN, String text)
{
}
}
Unity can't do this out of the box. The best you can do is:
container.RegisterType(
new InjectionConstructor(
typeof(IFoo), typeof(IFoo2), typeof(IFoo3), typeof(IFooN), "123"));
Or you can use the SmartConstructor
provided by the TecX project. This blog post describes some background.
Registration would look like this:
container.RegisterType(new SmartConstructor("text", "123"));