I have an object of type object which I know contains a list (both because of the nature of the problem and because I can see it in the debugger). I want to be able to iterate through the members of the list.
My problen is that I can't work how to cast the object onto an interface that would allow iteration. I have tried:
List<object> objList = (List<object>)objectContai
System.Array variantArray = (Array)objectContainingLis
//Simplified example of the problem:
//Generate a list containing integers
List<int> intList = new
//Loose all info about the object, remember this is a hypothetical example!
object objectContainingList = intList;
//Now I want to loop through the object
foreach (object obj in objectContainingList)