Converting List<Object> using a System.Type object
问题 Let's say I have retrieved a System.Type object using reflection and want to use that type to convert a List<Object> into another List of that type. If I try: Type type = GetTypeUsingReflection(); var myNewList = listObject.ConvertAll(x => Convert.ChangeType(x, type)); I get an exception since the object does not implement the IConvertible interface. Is there a way around this or another way to approach this problem? 回答1: Type type = typeof(int); // could as well be obtained by Reflection var