How can I dynamically register generic classes with a name with Unity?
问题 I have an assembly with a lot of classes (300+) with a BaseClass and I want register a generic class with a interface. With unity you have to register by { Name } if you want to resolve an array of objects of the interface. I want an array of objects in the MainViewModel automatically. Is there a way to automate this with reflection? Any suggestions? Example (pseudo): public class BaseClass { public void doFoo(); } public ClassNumber001 : BaseClass { } public ClassNumber002 : BaseClass { }