Voglio creare un elenco generico dell’object Type.
Io ho …
Type type = typeof(Foo); object model = GetModel();
Ora voglio creare un new List((Foo)model)
È ansible in C #?
Type listT = typeof(List<>).MakeGenericType(new[]{type}); object list = Activator.CreateInstance(listT);