mercredi 24 mai 2017

Instantiate a List

I would like to know if there is the possibility to instantiate a list of instances from textual class name. For example, I have this code below :

List<Person> Persons;

I would like to have this kind of control on specifiying class name for some objects:

string ClassName = "Person";
List<ClassName> Persons;

If there is some possibility using reflection, please help me, thank you.





Aucun commentaire:

Enregistrer un commentaire