title: dynamic typed list in razor template
body: <pre><code>// this function working perfectly
  public dynamic CountTable()
  {
      return (from t in db.Users
              group t by t.Type into g
              select new
              {
                  type = g.Key,
                  count = g.Count(),
                  ActiveGroups = (from t in g group t by t.Active into ag select new { active = ag.Key, count = ag.Count() })
              }).ToList();
  }
  </code></pre>
  
  <hr>
  
  <pre><code>    // and this loop working in MVC Controller
      foreach (dynamic uct in ur.CountTable())
      {
          int x = uct.count;
      }
  </code></pre>
  
  <p>But not working in template:</p>
  
  <pre><code>Line 12: @foreach (dynamic uct in ViewBag.ur.CountTable())
  Line 13: {
  Line 14:     int adet = uct.count;
  Line 15: }
  </code></pre>
  
  <p><strong>Line 14: 'object' does not contain a definition for 'count'</strong></p>
  
  <p>Why? What can I do?</p>