title: Two models in a view (with foreach)
body: <p>I have two classes - Student.cs and Lecturer.cs placed under Models. Now that in my razor view I have to place two classes together. </p>
  
  <p>I know there's a method Tuple to solve the problem. But I do not know what to do next. What should I do with my @foreach?</p>
  
  <p>Here's my code in cshtml.</p>
  
  <pre><code>@model Tuple&lt;MVCApp1.Models.Student, MVCApp1.Models.Lecturer&gt;
  
  @{
      ViewBag.Title = "MainPage";
      Layout = "~/Views/Shared/_Layout.cshtml";
  }
  </code></pre>
  
  <p>I'm using a table, below is my @foreach code section. </p>
  
  <pre><code>@foreach (var j in Model)
              {
                  &lt;tr&gt;
                      &lt;td"&gt;@j.FirstName
                      &lt;/td&gt;
                      &lt;td&gt;@j.MiddleName
                      &lt;/td&gt;
                      &lt;td&gt;@j.LastName
                      &lt;/td&gt;
  </code></pre>
  
  <p>I need to have 2 tables each with different attributes. First table from Student.cs and second table will be Lecturer.cs. 
  I know there is something wrong with the @foreach but I just can't find any solution online. Please help.</p>