title: How to read properties from anonymous types using "dynamic" variable
body: <p>I had the cunning idea of using a dynamic variable to test the results of a method that returns an anonymous type - more specifically it returns a JsonResult, which as json looks like this</p>
  
  <pre><code>{ "newData" : [ 1120741.2697475906,
        826527.64681837813
      ],
    "oldData" : [ 1849870.2326665826,
        1763440.5884212805
      ],
    "timeSteps" : [ 0,
        4.8828124999999998e-10
      ],
    "total" : 2
  }
  </code></pre>
  
  <p>I can read the JSonResult which will give me the anonymous type. Here's my code:</p>
  
  <pre><code>var jsonResult = controller.GetChangeData(1) as JsonResult;
  dynamic data = jsonResult.Data;
  Assert.AreEqual(2, data.total); // This works fine :)
  </code></pre>
  
  <p>But how do I get at "newData" for example? This code....</p>
  
  <pre><code>var newData = data.newData;
  </code></pre>
  
  <p>Gives me a System.Linq.Enumerable.WhereSelectArrayIterator, but I don't know what to do with it to be able to just use it as an arry of doubles.</p>
  
  <p>I tried casting it as a double[], but it doesn't work either.</p>
  
  <p>As an aside, can I easily check if a property is defined on the dynamic?</p>