title: LINQ with dynamic objects
body: <p>Try to sort through a bunch of examples, and can't seem to make this work ... which leads me to believe I might be trying the impossible! :)</p>
  
  <p>I have the following code in my view:</p>
  
  <pre><code>&lt;fieldset&gt;
      &lt;legend&gt;Map&lt;/legend&gt;
      &lt;table class="map"&gt;
          @for (var y = 0; y &lt;= (int)ViewBag.Map.Height; y++)
          {
              &lt;tr&gt;
                  @for (var x = 0; x &lt;= (int)ViewBag.Map.Width; x++)
                  {
                      &lt;td&gt;@ViewBag.Map.MapTiles.Where(z =&gt; z.X == x &amp;&amp; z.Y == y)&lt;/td&gt;
                  }
              &lt;/tr&gt;                
          }
      &lt;/table&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>Map is a <code>dynamic</code> object.</p>
  
  <p>When I run this,  I get the following error:</p>
  
  <p>Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type</p>
  
  <p>Is there a way to get around this and keep my LINQ query simple?</p>