title: Add data from two tables in one view MVC 4
body: <p>I am trying to add data from two different table in one view. Here somne code:
  Code of viewmodel</p>
  
  <pre><code>public class ProductIndexData
  {
      public IEnumerable&lt;Order&gt; Orders { get; set; }
      public IEnumerable&lt;Magnet&gt; Magnets { get; set; }
      public IEnumerable&lt;Map&gt; Maps { get; set; }
      public IEnumerable&lt;Portrait&gt; Portraits { get; set; }
      public IEnumerable&lt;Tablet&gt; Tablets { get; set; }
      public IEnumerable&lt;Other&gt; Others { get; set; }
  }
  </code></pre>
  
  <p>Code of controller:</p>
  
  <pre><code>public ActionResult Index()
      {
          ProductIndexData products = new ProductIndexData();
          products.Magnets = (from o in db.Magnets select o).ToList();
          return View(products);
      }
  </code></pre>
  
  <p>Code of view:</p>
  
  <pre><code>@model List&lt;SvLaserIS.ProductIndexData&gt;
  @{
      ViewBag.Title = "Product";
  }
  
  &lt;h2&gt;Product&lt;/h2&gt;
  &lt;table&gt;
  @foreach (var item in Model) {
      foreach(SvLaserIS.Models.Magnet magnet in item) {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; magnet.Count)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; magnet.Model)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; magnet.Color)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; magnet.FullPrice)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.ActionLink("Edit", "Edit", new {  }) |
              @Html.ActionLink("Details", "Details", new {  }) |
              @Html.ActionLink("Delete", "Delete", new {  }) 
          &lt;/td&gt;
      &lt;/tr&gt;
      }
  }
      &lt;/table&gt;
  </code></pre>
  
  <p>After compilation i ve got error in the second foreach cycle in view that says its not contait the definition for GetEnumerator. Looking for help with it :/</p>