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?
But why on Earth would you need it?