Unity InjectionConstructor for multiparam constructor overriding only single one

前端 未结 3 2089
长发绾君心
长发绾君心 2021-01-03 17:35

I have a class with constructor like this:

public class Bar
{
    public Bar(IFoo foo, IFoo2 foo2, IFoo3 foo3, IFooN fooN, String text)
    {

    }
}
         


        
3条回答
  •  孤街浪徒
    2021-01-03 18:20

    public void Register(params object[] constructorParams) where TFrom : class
            {
                _container.RegisterType(new InjectionConstructor(constructorParams));
            }
    

提交回复
热议问题