Ich habe 3 Liste Typ Liste.Cast Objekt auf generische Liste
List<Contact> = new List<Contact>();
List<Address> = new List<Address>();
List<Document> = new List<Document>();
Und speichern Sie es auf eine Variable mit Typ Objekt. Jetzt nedd i do Cast Zurück zur Liste ein foreach perfom, einige wie folgt aus:
List<Contact> = (List<Contact>)obj;
Aber obj Inhalt ändern jedes Mal, und ich habe einige wie folgt aus:
List<???> = (List<???>)obj;
Ich habe eine andere variable Halte Strom obj Typ:
Type t = typeof(obj);
kann ich tun, etwas, was wie die ??:
List<t> = (List<t>)obj;
Obs: I der aktuelle Typ in der Liste nicht, aber ich werfen müssen, und ich nicht jetzt eine andere Form statt:
List<Contact> = new List<Contact>();
in Zukunft ich mehr Objekte benötigen, arbeiten nicht thank's !! – JoeLoco
es Mann arbeiten, 7 Stunden, Dank lottttttttttttttt !!!!!! – JoeLoco