title: How to foreach iterate razor item that contain collection list?
body: <p>How to iterate this Result list item in razor?</p>
  
  <p>My Controller : </p>
  
  <pre><code>ViewBag.DataGrid = lst. GroupBy(x=&gt; new { x.PosisiJabatanId, x.AplikasiId}, (key, group) =&gt; new 
                                           {
                                               Key1 = key.PosisiJabatanId,
                                               Key2 = key.AplikasiId,
                                               Result = group.ToList() 
                                           });
  </code></pre>
  
  <p>My Razor View :</p>
  
  <pre><code>@foreach (var item in @ViewBag.DataGrid)
              {
                  @:&lt;tr&gt;
                      &lt;td&gt;@i&lt;/td&gt;
                      &lt;td&gt;@item.Result.Organisasi&lt;/td&gt;
                      &lt;td&gt;@item.Result.NamaAplikasi&lt;/td&gt;
                      &lt;td&gt;@item.Result.Unit&lt;/td&gt;
                      &lt;td&gt;@item.Result.PosisiJabatanId&lt;/td&gt;
  
                  i = i + 1;
                  @:&lt;/tr&gt;
              }
  </code></pre>
  
  <p>But <strong>'object' does not contain a definition for 'Result'</strong></p>