title: .NET Reflection: how do I loop through an object that is an array type?
body: <p>I've got a method that returns an array, the type of which I have stored in a Type object further up. The code I have for this is thus:</p>
  
  <pre><code>Type StoryType = Type.GetType("my.ns.Story");
  Type StoryTypeArray = Type.GetType("my.ns.Story[]");
  
  object stories = SomeMethodInfo.Invoke(BigFatObject,some_params);
  </code></pre>
  
  <p>In this example, I know stories is of type <code>StoryTypeArray</code>, and what I really want to do is something like:</p>
  
  <pre><code>foreach (Story instance in stories) { ... }
  </code></pre>
  
  <p>However, I can't figure out how to turn the object <code>stories</code> into something I can loop through and pull data out of. </p>
  
  <p>Any ideas?</p>