Injecting arrays with Unity
问题 My goal is to constructor inject an array of objects implementing an interface. The following is the way I currently have it. Container .RegisterInstance<Company>(ParseCompany(args[1]) .RegisterInstance<eTargets>(ParseTargets(args[2])) .RegisterInstance<ILoader[]>(new ILoader[] { Container.Resolve<CustomerLoader>(), Container.Resolve<PaymentLoader(), Container.Resolve<InvoiceLoader() }); Is it typical to call Resolve in container configuration this way or is there a more standard way to